Skip to content

Commit a40f6a8

Browse files
authored
🐛 FIX: empty lines after blockquote+footnote (#134)
1 parent 261dc90 commit a40f6a8

File tree

3 files changed

+35
-5
lines changed

3 files changed

+35
-5
lines changed

markdown_it/parser_block.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,12 @@ def tokenize(
8181
# i.e. latest empty line should not count
8282
state.tight = not hasEmptyLines
8383

84+
line = state.line
85+
8486
# paragraph might "eat" one newline after it in nested lists
85-
if state.isEmpty(state.line - 1):
87+
if (line - 1) < endLine and state.isEmpty(line - 1):
8688
hasEmptyLines = True
8789

88-
line = state.line
89-
9090
if line < endLine and state.isEmpty(line):
9191
hasEmptyLines = True
9292
line += 1

tests/test_plugins/fixtures/footnote.md

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,4 +297,32 @@ hij</p>
297297
<a href="#fnref1" class="footnote-backref">↩︎</a></li>
298298
</ol>
299299
</section>
300-
.
300+
.
301+
302+
issue-133
303+
.
304+
> b [^1]
305+
306+
Some text
307+
308+
> c
309+
310+
[^1]: d
311+
312+
313+
.
314+
<blockquote>
315+
<p>b <sup class="footnote-ref"><a href="#fn1" id="fnref1">[1]</a></sup></p>
316+
</blockquote>
317+
<p>Some text</p>
318+
<blockquote>
319+
<p>c</p>
320+
</blockquote>
321+
<hr class="footnotes-sep">
322+
<section class="footnotes">
323+
<ol class="footnotes-list">
324+
<li id="fn1" class="footnote-item"><p>d <a href="#fnref1" class="footnote-backref">↩︎</a></p>
325+
</li>
326+
</ol>
327+
</section>
328+
.

tox.ini

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ envlist = py37
1010
usedevelop = true
1111

1212
[testenv:py{36,37,38}]
13-
extras = testing
13+
extras =
14+
linkify
15+
testing
1416
commands = pytest {posargs}
1517

1618
[testenv:py{36,37,38}-bench-core]

0 commit comments

Comments
 (0)