Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion markdown_it/rules_block/blockquote.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
50 changes: 50 additions & 0 deletions tests/test_port/fixtures/issue-fixes.md
Original file line number Diff line number Diff line change
Expand Up @@ -244,3 +244,53 @@ para
*a*
</pre>
.

#473 a `>` indented by 4+ spaces on a continuation line is not a block quote marker
.
> a
> b
.
<blockquote>
<p>a
&gt; b</p>
</blockquote>
.

#473 same inside a list item
.
- > a
> b
.
<ul>
<li>
<blockquote>
<p>a
&gt; b</p>
</blockquote>
</li>
</ul>
.

#473 same inside a nested block quote
.
> > a
> > b
.
<blockquote>
<blockquote>
<p>a
&gt; b</p>
</blockquote>
</blockquote>
.

#473 a `>` indented by 3 spaces still continues the block quote
.
> a
> b
.
<blockquote>
<p>a
b</p>
</blockquote>
.