Browse Source

Allow EOL in processing instructions

same fix as in https://github.com/commonmark/commonmark.js/issues/196
pull/745/head
Alex Kocharin 4 years ago
parent
commit
8ad16ac4d9
  1. 1
      CHANGELOG.md
  2. 2
      lib/common/html_re.js
  3. 10
      test/fixtures/markdown-it/commonmark_extras.txt

1
CHANGELOG.md

@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- `[](url\ xxx)` is no longer a valid link. - `[](url\ xxx)` is no longer a valid link.
- Fix performance issues when parsing links (#732, #734), backticks, (#733, #736), - Fix performance issues when parsing links (#732, #734), backticks, (#733, #736),
emphases (#735), and autolinks (#737). emphases (#735), and autolinks (#737).
- Allow newline in `<? ... ?>` in an inline context.
## [12.0.2] - 2020-10-23 ## [12.0.2] - 2020-10-23

2
lib/common/html_re.js

@ -16,7 +16,7 @@ var open_tag = '<[A-Za-z][A-Za-z0-9\\-]*' + attribute + '*\\s*\\/?>';
var close_tag = '<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>'; var close_tag = '<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>';
var comment = '<!---->|<!--(?:-?[^>-])(?:-?[^-])*-->'; var comment = '<!---->|<!--(?:-?[^>-])(?:-?[^-])*-->';
var processing = '<[?].*?[?]>'; var processing = '<[?][\\s\\S]*?[?]>';
var declaration = '<![A-Z]+\\s+[^>]*>'; var declaration = '<![A-Z]+\\s+[^>]*>';
var cdata = '<!\\[CDATA\\[[\\s\\S]*?\\]\\]>'; var cdata = '<!\\[CDATA\\[[\\s\\S]*?\\]\\]>';

10
test/fixtures/markdown-it/commonmark_extras.txt

@ -286,6 +286,16 @@ Escaped space is not allowed in link destination, commonmark/CommonMark#493.
. .
Allow EOL in processing instructions, commonmark/commonmark.js#196.
.
a <?
?>
.
<p>a <?
?></p>
.
Coverage. Directive can terminate paragraph. Coverage. Directive can terminate paragraph.
. .
a a

Loading…
Cancel
Save