Skip to content

Commit d442f57

Browse files
committed
Merge pull request Python-Markdown#429 from Tigge/patch-1
Fix find footnote placeholder to recurse
2 parents 904d4e6 + c3f7b2b commit d442f57

File tree

3 files changed

+21
-1
lines changed

3 files changed

+21
-1
lines changed

markdown/extensions/footnotes.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,9 @@ def finder(element):
9696
if child.tail:
9797
if child.tail.find(self.getConfig("PLACE_MARKER")) > -1:
9898
return child, element, False
99-
finder(child)
99+
child_res = finder(child)
100+
if child_res is not None:
101+
return child_res
100102
return None
101103

102104
res = finder(root)
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<blockquote>
2+
<blockquote>
3+
<div class="footnote">
4+
<hr />
5+
<ol>
6+
<li id="fn:1">
7+
<p>A Footnote.&#160;<a class="footnote-backref" href="#fnref:1" rev="footnote" title="Jump back to footnote 1 in the text">&#8617;</a></p>
8+
</li>
9+
</ol>
10+
</div>
11+
<p>Some text with a footnote<sup id="fnref:1"><a class="footnote-ref" href="#fn:1" rel="footnote">1</a></sup>.</p>
12+
</blockquote>
13+
</blockquote>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
>> ///Footnotes Go Here///
2+
>>
3+
>> Some text with a footnote[^1].
4+
5+
[^1]: A Footnote.

0 commit comments

Comments
 (0)