diff --git a/lib/rules_block/html_block.mjs b/lib/rules_block/html_block.mjs index 197520f..168da28 100644 --- a/lib/rules_block/html_block.mjs +++ b/lib/rules_block/html_block.mjs @@ -46,7 +46,10 @@ export default function html_block (state, startLine, endLine, silent) { // Let's roll down till block end. if (!HTML_SEQUENCES[i][1].test(lineText)) { for (; nextLine < endLine; nextLine++) { - if (state.sCount[nextLine] < state.blkIndent) { break } + if (state.sCount[nextLine] < state.blkIndent) { + // Allow empty lines to stay inside list items per CommonMark rules. + if (!(state.listIndent >= 0 && state.isEmpty(nextLine))) { break } + } pos = state.bMarks[nextLine] + state.tShift[nextLine] max = state.eMarks[nextLine] diff --git a/test/fixtures/markdown-it/commonmark_extras.txt b/test/fixtures/markdown-it/commonmark_extras.txt index 558c011..35dfc64 100644 --- a/test/fixtures/markdown-it/commonmark_extras.txt +++ b/test/fixtures/markdown-it/commonmark_extras.txt @@ -740,3 +740,29 @@ Html in image description .

item
+para
+ +c
+