diff --git a/markdown/extensions/footnotes.py b/markdown/extensions/footnotes.py index d8caae27c..b52815f3c 100644 --- a/markdown/extensions/footnotes.py +++ b/markdown/extensions/footnotes.py @@ -96,7 +96,9 @@ def finder(element): 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 000000000..9793a493e --- /dev/null +++ b/tests/extensions/extra/footnote_placeholder_depth.html @@ -0,0 +1,13 @@ +
+\ 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 000000000..cfe87c00f --- /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.++++
++
+- +
+A Footnote. ↩
+Some text with a footnote1.
+