Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 FIX: Parsing when newline is between footnote ID and first paragraph #49

Merged
merged 1 commit into from
Aug 25, 2022
Merged
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
2 changes: 1 addition & 1 deletion mdit_py_plugins/footnote/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def footnote_def(state: StateBlock, startLine: int, endLine: int, silent: bool):
if pos == start + 2: # no empty footnote labels
return False
pos += 1
if pos + 1 >= maximum or state.srcCharCode[pos] != 0x3A: # /* : */
if pos >= maximum or state.srcCharCode[pos] != 0x3A: # /* : */
return False
if silent:
return True
Expand Down
18 changes: 18 additions & 0 deletions tests/fixtures/footnote.md
Original file line number Diff line number Diff line change
Expand Up @@ -326,3 +326,21 @@ Some text
</ol>
</section>
.


Newline after footnote identifier
.
[^a]

[^a]:
b
.
<p><sup class="footnote-ref"><a href="#fn1" id="fnref1">[1]</a></sup></p>
<p>b</p>
<hr class="footnotes-sep">
<section class="footnotes">
<ol class="footnotes-list">
<li id="fn1" class="footnote-item"> <a href="#fnref1" class="footnote-backref"><-</a></li>
</ol>
</section>
.