Skip to content

Commit ccb930e

Browse files
committed
👌 IMPROVE: Allow newline in <? ... ?> in an inline context
Same same fix as in commonmark/commonmark.js#196 Implements: markdown-it/markdown-it@8ad16ac
1 parent 2984159 commit ccb930e

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

markdown_it/common/html_re.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
close_tag = "<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>"
1919
comment = "<!---->|<!--(?:-?[^>-])(?:-?[^-])*-->"
20-
processing = "<[?].*?[?]>"
20+
processing = "<[?][\\s\\S]*?[?]>"
2121
declaration = "<![A-Z]+\\s+[^>]*>"
2222
cdata = "<!\\[CDATA\\[[\\s\\S]*?\\]\\]>"
2323

tests/test_port/fixtures/commonmark_extras.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,15 @@ List item terminating quote should not be paragraph continuation
255255
</ol>
256256
.
257257

258+
Allow EOL in processing instructions, commonmark/commonmark.js#196.
259+
.
260+
a <?
261+
?>
262+
.
263+
<p>a <?
264+
?></p>
265+
.
266+
258267
Allow meta tag in an inline context, commonmark/commonmark-spec#527.
259268
.
260269
City:

0 commit comments

Comments
 (0)