diff --git a/mdit_py_plugins/myst_blocks/index.py b/mdit_py_plugins/myst_blocks/index.py index 14fbbd3..f7437e8 100644 --- a/mdit_py_plugins/myst_blocks/index.py +++ b/mdit_py_plugins/myst_blocks/index.py @@ -65,6 +65,8 @@ def line_comment(state: StateBlock, startLine: int, endLine: int, silent: bool) pos = state.bMarks[nextLine] + state.tShift[nextLine] maximum = state.eMarks[nextLine] + if state.sCount[nextLine] < state.blkIndent: + break if state.src[pos] != "%": break token.content += "\n" + state.src[pos + 1 : maximum].rstrip() diff --git a/tests/fixtures/myst_block.md b/tests/fixtures/myst_block.md index 515daf4..debf21e 100644 --- a/tests/fixtures/myst_block.md +++ b/tests/fixtures/myst_block.md @@ -148,6 +148,18 @@ def -->
def --> . +Multiline comment in list item: +. +- a + % abc +% def +. ++
+ +. + Indented by 4 spaces .- a
+