From 5acc7d48c73975769aeb4a5bc0f140d470d85a55 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 6 Feb 2021 22:57:34 -0800 Subject: [PATCH] Fix issue with type-7 HTML blocks interrupting paragraphs. See commonmark/commonmark.js#213. --- src/blocks.c | 1 + test/regression.txt | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/src/blocks.c b/src/blocks.c index f2eeb05e4..64bb7f48c 100644 --- a/src/blocks.c +++ b/src/blocks.c @@ -1014,6 +1014,7 @@ static void open_new_blocks(cmark_parser *parser, cmark_node **container, } else if (!indented && ((matched = scan_html_block_start( input, parser->first_nonspace)) || (cont_type != CMARK_NODE_PARAGRAPH && + !maybe_lazy && (matched = scan_html_block_start_7( input, parser->first_nonspace))))) { *container = add_child(parser, *container, CMARK_NODE_HTML_BLOCK, diff --git a/test/regression.txt b/test/regression.txt index d77c8f268..f2d293532 100644 --- a/test/regression.txt +++ b/test/regression.txt @@ -162,3 +162,23 @@ Issue #334 - UTF-8 BOM .

Hi

```````````````````````````````` + +Issue commonmark.js#213 - type 7 blocks can't interrupt +paragraph + +```````````````````````````````` example +- +. + +```````````````````````````````` +