From 8ad16ac4d9c9345e0634e617d3bed874a24c6a4e Mon Sep 17 00:00:00 2001 From: Alex Kocharin Date: Wed, 25 Nov 2020 20:32:58 +0300 Subject: [PATCH] Allow EOL in processing instructions same fix as in https://github.com/commonmark/commonmark.js/issues/196 --- CHANGELOG.md | 1 + lib/common/html_re.js | 2 +- test/fixtures/markdown-it/commonmark_extras.txt | 10 ++++++++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0240c6a..ca95c58 100644 --- a/CHANGELOG.md +++ b/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. - Fix performance issues when parsing links (#732, #734), backticks, (#733, #736), emphases (#735), and autolinks (#737). +- Allow newline in `` in an inline context. ## [12.0.2] - 2020-10-23 diff --git a/lib/common/html_re.js b/lib/common/html_re.js index 4fd9369..df81906 100644 --- a/lib/common/html_re.js +++ b/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 comment = '|'; -var processing = '<[?].*?[?]>'; +var processing = '<[?][\\s\\S]*?[?]>'; var declaration = ']*>'; var cdata = ''; diff --git a/test/fixtures/markdown-it/commonmark_extras.txt b/test/fixtures/markdown-it/commonmark_extras.txt index 56b4a31..8e34e58 100644 --- a/test/fixtures/markdown-it/commonmark_extras.txt +++ b/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 +. +

a

+. + + Coverage. Directive can terminate paragraph. . a