diff options
author | Gustav Tiger <gustav@tiger.name> | 2015-08-28 14:01:09 +0200 |
---|---|---|
committer | Gustav Tiger <gustav@tiger.name> | 2015-08-29 09:55:36 +0200 |
commit | c3f7b2ba327c729a36e2a3705514db1742267700 (patch) | |
tree | b48109a6e8720e445c5682186c6fe381ffab089d | |
parent | 904d4e6d9c8910c3feca52c82382486d51505a3b (diff) | |
download | markdown-c3f7b2ba327c729a36e2a3705514db1742267700.tar.gz markdown-c3f7b2ba327c729a36e2a3705514db1742267700.tar.bz2 markdown-c3f7b2ba327c729a36e2a3705514db1742267700.zip |
Fix find footnote placeholder to recurse
-rw-r--r-- | markdown/extensions/footnotes.py | 4 | ||||
-rw-r--r-- | tests/extensions/extra/footnote_placeholder_depth.html | 13 | ||||
-rw-r--r-- | tests/extensions/extra/footnote_placeholder_depth.txt | 5 |
3 files changed, 21 insertions, 1 deletions
diff --git a/markdown/extensions/footnotes.py b/markdown/extensions/footnotes.py index d8caae2..b52815f 100644 --- a/markdown/extensions/footnotes.py +++ b/markdown/extensions/footnotes.py @@ -96,7 +96,9 @@ class FootnoteExtension(Extension): if child.tail: if child.tail.find(self.getConfig("PLACE_MARKER")) > -1: return child, element, False - finder(child) + child_res = finder(child) + if child_res is not None: + return child_res return None res = finder(root) diff --git a/tests/extensions/extra/footnote_placeholder_depth.html b/tests/extensions/extra/footnote_placeholder_depth.html new file mode 100644 index 0000000..9793a49 --- /dev/null +++ b/tests/extensions/extra/footnote_placeholder_depth.html @@ -0,0 +1,13 @@ +<blockquote> +<blockquote> +<div class="footnote"> +<hr /> +<ol> +<li id="fn:1"> +<p>A Footnote. <a class="footnote-backref" href="#fnref:1" rev="footnote" title="Jump back to footnote 1 in the text">↩</a></p> +</li> +</ol> +</div> +<p>Some text with a footnote<sup id="fnref:1"><a class="footnote-ref" href="#fn:1" rel="footnote">1</a></sup>.</p> +</blockquote> +</blockquote>
\ No newline at end of file diff --git a/tests/extensions/extra/footnote_placeholder_depth.txt b/tests/extensions/extra/footnote_placeholder_depth.txt new file mode 100644 index 0000000..cfe87c0 --- /dev/null +++ b/tests/extensions/extra/footnote_placeholder_depth.txt @@ -0,0 +1,5 @@ +>> ///Footnotes Go Here/// +>> +>> Some text with a footnote[^1]. + +[^1]: A Footnote. |