Skip to content

Commit 2a67873

Browse files
authored
🐛 FIX: Combination of blockquotes, list and newlines causes IndexError (#207)
1 parent 8928b0e commit 2a67873

File tree

3 files changed

+22
-4
lines changed

3 files changed

+22
-4
lines changed

markdown_it/rules_block/blockquote.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,4 @@ def blockquote(state: StateBlock, startLine: int, endLine: int, silent: bool):
296296

297297
state.blkIndent = oldIndent
298298

299-
state.lineMax += 1
300-
301299
return True

markdown_it/rules_block/state_block.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,7 @@ def skipEmptyLines(self, from_pos: int) -> int:
147147
]:
148148
break
149149
except IndexError:
150-
from_pos += 1
151-
break
150+
pass
152151
from_pos += 1
153152
return from_pos
154153

tests/test_port/fixtures/commonmark_extras.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -673,3 +673,24 @@ Issue #205. Space in link destination generates IndexError
673673
<p>[Contact](http:// mail.com)</p>
674674
<p>[Contact](mailto: mail@mail.com)</p>
675675
.
676+
677+
Issue #204. Combination of blockquotes, list and newlines causes an IndexError
678+
.
679+
> QUOTE
680+
+ UNORDERED LIST ITEM
681+
> INDENTED QUOTE
682+
683+
684+
685+
.
686+
<blockquote>
687+
<p>QUOTE</p>
688+
</blockquote>
689+
<ul>
690+
<li>UNORDERED LIST ITEM
691+
<blockquote>
692+
<p>INDENTED QUOTE</p>
693+
</blockquote>
694+
</li>
695+
</ul>
696+
.

0 commit comments

Comments
 (0)