aboutsummaryrefslogtreecommitdiffstats
path: root/mdx_footnotes.py
diff options
context:
space:
mode:
Diffstat (limited to 'mdx_footnotes.py')
-rw-r--r--mdx_footnotes.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/mdx_footnotes.py b/mdx_footnotes.py
index 56ffd3a..b9641ce 100644
--- a/mdx_footnotes.py
+++ b/mdx_footnotes.py
@@ -116,7 +116,7 @@ class FootnoteExtension (markdown.Extension):
li = doc.createElement('li')
li.setAttribute('id', self.makeFootnoteId(i))
- self.md._processSection(li, self.footnotes[id].split("\n"))
+ self.md._processSection(li, self.footnotes[id].split("\n"), looseList=1)
#li.appendChild(doc.createTextNode(self.footnotes[id]))
@@ -130,8 +130,13 @@ class FootnoteExtension (markdown.Extension):
if li.childNodes :
node = li.childNodes[-1]
if node.type == "text" :
- node = li
- node.appendChild(backlink)
+ li.appendChild(backlink)
+ elif node.nodeName == "p":
+ node.appendChild(backlink)
+ else:
+ p = doc.createElement('p')
+ p.appendChild(backlink)
+ li.appendChild(p)
ol.appendChild(li)