Skip to content

Commit 855067e

Browse files
authored
šŸ› FIX: Parsing when newline is between footnote ID and first paragraph (#49)
1 parent d627eac commit 855067e

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

ā€Žmdit_py_plugins/footnote/index.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def footnote_def(state: StateBlock, startLine: int, endLine: int, silent: bool):
8080
if pos == start + 2: # no empty footnote labels
8181
return False
8282
pos += 1
83-
if pos + 1 >= maximum or state.srcCharCode[pos] != 0x3A: # /* : */
83+
if pos >= maximum or state.srcCharCode[pos] != 0x3A: # /* : */
8484
return False
8585
if silent:
8686
return True

ā€Žtests/fixtures/footnote.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,3 +326,21 @@ Some text
326326
</ol>
327327
</section>
328328
.
329+
330+
331+
Newline after footnote identifier
332+
.
333+
[^a]
334+
335+
[^a]:
336+
b
337+
.
338+
<p><sup class="footnote-ref"><a href="#fn1" id="fnref1">[1]</a></sup></p>
339+
<p>b</p>
340+
<hr class="footnotes-sep">
341+
<section class="footnotes">
342+
<ol class="footnotes-list">
343+
<li id="fn1" class="footnote-item"> <a href="#fnref1" class="footnote-backref"><-</a></li>
344+
</ol>
345+
</section>
346+
.

0 commit comments

Comments
Ā (0)