Skip to content

Commit

Permalink
🐛 FIX: Combination of blockquotes, list and newlines causes IndexError (
Browse files Browse the repository at this point in the history
  • Loading branch information
hukkin authored Apr 15, 2022
1 parent 8928b0e commit 2a67873
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 4 deletions.
2 changes: 0 additions & 2 deletions markdown_it/rules_block/blockquote.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,4 @@ def blockquote(state: StateBlock, startLine: int, endLine: int, silent: bool):

state.blkIndent = oldIndent

state.lineMax += 1

return True
3 changes: 1 addition & 2 deletions markdown_it/rules_block/state_block.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,7 @@ def skipEmptyLines(self, from_pos: int) -> int:
]:
break
except IndexError:
from_pos += 1
break
pass
from_pos += 1
return from_pos

Expand Down
21 changes: 21 additions & 0 deletions tests/test_port/fixtures/commonmark_extras.md
Original file line number Diff line number Diff line change
Expand Up @@ -673,3 +673,24 @@ Issue #205. Space in link destination generates IndexError
<p>[Contact](http:// mail.com)</p>
<p>[Contact](mailto: [email protected])</p>
.

Issue #204. Combination of blockquotes, list and newlines causes an IndexError
.
> QUOTE
+ UNORDERED LIST ITEM
> INDENTED QUOTE



.
<blockquote>
<p>QUOTE</p>
</blockquote>
<ul>
<li>UNORDERED LIST ITEM
<blockquote>
<p>INDENTED QUOTE</p>
</blockquote>
</li>
</ul>
.

0 comments on commit 2a67873

Please sign in to comment.