diff --git a/markdown_it/rules_block/html_block.py b/markdown_it/rules_block/html_block.py index 3d43f6ee..fee2a1a0 100644 --- a/markdown_it/rules_block/html_block.py +++ b/markdown_it/rules_block/html_block.py @@ -68,7 +68,7 @@ def html_block(state: StateBlock, startLine: int, endLine: int, silent: bool) -> # Let's roll down till block end. if not html_seq[1].search(lineText): while nextLine < endLine: - if state.sCount[nextLine] < state.blkIndent: + if state.sCount[nextLine] < state.blkIndent and not state.isEmpty(nextLine): break pos = state.bMarks[nextLine] + state.tShift[nextLine] diff --git a/tests/test_port/fixtures/commonmark_extras.md b/tests/test_port/fixtures/commonmark_extras.md index f0b31dbd..0cb8d978 100644 --- a/tests/test_port/fixtures/commonmark_extras.md +++ b/tests/test_port/fixtures/commonmark_extras.md @@ -749,3 +749,27 @@ Issue #204. Combination of blockquotes, list and newlines causes an IndexError . + +Issue #377. HTML comment block inside list item should not end at blank line +. +1. item + + + paragraph +. +
    +
  1. +

    item

    + +

    paragraph

    +
  2. +
+.