Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Add loose list test
  • Loading branch information
waylan committed Jul 30, 2025
commit 62b12b73133c906a137ef53d19c27feb0d575b0f
39 changes: 39 additions & 0 deletions tests/test_syntax/extensions/test_footnotes.py
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,45 @@ def test_footnote_reference_within_list(self):
'</div>'
)

def test_footnote_references_within_loose_list(self):
"""Test footnote reference within a list item."""

self.assertMarkdownRenders(
self.dedent(
'''
* Reference to [^first]

* Reference to [^second]

[^first]: First footnote definition
[^second]: Second footnote definition
'''
),
self.dedent(
'''
<ul>
<li>
<p>Reference to <sup id="fnref:first"><a class="footnote-ref" href="#fn:first">1</a></sup></p>
</li>
<li>
<p>Reference to <sup id="fnref:second"><a class="footnote-ref" href="#fn:second">2</a></sup></p>
</li>
</ul>
<div class="footnote">
<hr />
<ol>
<li id="fn:first">
<p>First footnote definition&#160;<a class="footnote-backref" href="#fnref:first" title="Jump back to footnote 1 in the text">&#8617;</a></p>
</li>
<li id="fn:second">
<p>Second footnote definition&#160;<a class="footnote-backref" href="#fnref:second" title="Jump back to footnote 2 in the text">&#8617;</a></p>
</li>
</ol>
</div>
'''
)
)

def test_footnote_reference_within_html(self):
"""Test footnote reference within HTML tags."""

Expand Down
Loading