Skip to content

Commit 62b12b7

Browse files
committed
Add loose list test
1 parent 1c160ef commit 62b12b7

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

tests/test_syntax/extensions/test_footnotes.py

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,45 @@ def test_footnote_reference_within_list(self):
470470
'</div>'
471471
)
472472

473+
def test_footnote_references_within_loose_list(self):
474+
"""Test footnote reference within a list item."""
475+
476+
self.assertMarkdownRenders(
477+
self.dedent(
478+
'''
479+
* Reference to [^first]
480+
481+
* Reference to [^second]
482+
483+
[^first]: First footnote definition
484+
[^second]: Second footnote definition
485+
'''
486+
),
487+
self.dedent(
488+
'''
489+
<ul>
490+
<li>
491+
<p>Reference to <sup id="fnref:first"><a class="footnote-ref" href="#fn:first">1</a></sup></p>
492+
</li>
493+
<li>
494+
<p>Reference to <sup id="fnref:second"><a class="footnote-ref" href="#fn:second">2</a></sup></p>
495+
</li>
496+
</ul>
497+
<div class="footnote">
498+
<hr />
499+
<ol>
500+
<li id="fn:first">
501+
<p>First footnote definition&#160;<a class="footnote-backref" href="#fnref:first" title="Jump back to footnote 1 in the text">&#8617;</a></p>
502+
</li>
503+
<li id="fn:second">
504+
<p>Second footnote definition&#160;<a class="footnote-backref" href="#fnref:second" title="Jump back to footnote 2 in the text">&#8617;</a></p>
505+
</li>
506+
</ol>
507+
</div>
508+
'''
509+
)
510+
)
511+
473512
def test_footnote_reference_within_html(self):
474513
"""Test footnote reference within HTML tags."""
475514

0 commit comments

Comments
 (0)