diff --git a/markdown_it/rules_block/blockquote.py b/markdown_it/rules_block/blockquote.py index de2d4f2d..e00b510f 100644 --- a/markdown_it/rules_block/blockquote.py +++ b/markdown_it/rules_block/blockquote.py @@ -147,7 +147,13 @@ def blockquote(state: StateBlock, startLine: int, endLine: int, silent: bool) -> # Case 1: line is not inside the blockquote, and this line is empty. break - evaluatesTrue = state.src[pos] == ">" and not isOutdented + # A `>` indented by 4+ spaces is not a block quote marker + # (it is lazy paragraph continuation text instead). + evaluatesTrue = ( + state.src[pos] == ">" + and not isOutdented + and not state.is_code_block(nextLine) + ) pos += 1 if evaluatesTrue: # This line is inside the blockquote. diff --git a/tests/test_port/fixtures/issue-fixes.md b/tests/test_port/fixtures/issue-fixes.md index fefef099..369be9bc 100644 --- a/tests/test_port/fixtures/issue-fixes.md +++ b/tests/test_port/fixtures/issue-fixes.md @@ -244,3 +244,53 @@ para *a* . + +#473 a `>` indented by 4+ spaces on a continuation line is not a block quote marker +. +> a + > b +. +
++. + +#473 same inside a list item +. +- > a + > b +. +a +> b
+
++a +> b
+
++. + +#473 a `>` indented by 3 spaces still continues the block quote +. +> a + > b +. +++a +> b
+
++.a +b
+