aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Wolever <wolever@cs.toronto.edu>2008-02-26 21:02:34 +0000
committerDavid Wolever <wolever@cs.toronto.edu>2008-02-26 21:02:34 +0000
commitc33803ad2e84cdce6e4ebf2c66d450216aefbe7f (patch)
treef69da685d8bc6fe463992b615254ce42d912087b
parent231b7784e66edf8a5fb26ccfd363a82ab2dcc7e2 (diff)
downloadmarkdown-c33803ad2e84cdce6e4ebf2c66d450216aefbe7f.tar.gz
markdown-c33803ad2e84cdce6e4ebf2c66d450216aefbe7f.tar.bz2
markdown-c33803ad2e84cdce6e4ebf2c66d450216aefbe7f.zip
Added an example of how to use footnotes, fixed a small bug where the return link's title always said "Jump back to footnote 1"
-rw-r--r--mdx_footnotes.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/mdx_footnotes.py b/mdx_footnotes.py
index bc8688b..4464c50 100644
--- a/mdx_footnotes.py
+++ b/mdx_footnotes.py
@@ -13,6 +13,14 @@ Footnote functionality is attached by calling extendMarkdown()
method of FootnoteExtension. The method also registers the
extension to allow it's state to be reset by a call to reset()
method.
+
+Example:
+ Footnotes[^1] have a label[^label] and a definition[^!DEF].
+
+ [^1]: This is a footnote
+ [^label]: A footnote on "label"
+ [^!DEF]: The footnote for definition
+
"""
FN_BACKLINK_TEXT = "zz1337820767766393qq"
@@ -124,7 +132,7 @@ class FootnoteExtension (markdown.Extension):
backlink.setAttribute('href', '#' + self.makeFootnoteRefId(i))
backlink.setAttribute('class', 'footnoteBackLink')
backlink.setAttribute('title',
- 'Jump back to footnote %d in the text' % 1)
+ 'Jump back to footnote %d in the text' % i)
backlink.appendChild(doc.createTextNode(FN_BACKLINK_TEXT))
if li.childNodes :