aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorWaylan Limberg <waylan.limberg@icloud.com>2017-03-08 19:03:27 -0500
committerWaylan Limberg <waylan.limberg@icloud.com>2017-03-08 19:03:27 -0500
commitcd752c06a6982effd530cd14924bc94459dcd043 (patch)
treefeabac28a76f2e096caa6d54bc3593564764f91a /tests
parentfd4d1d2183b6f1f41445ba0461799da71adfb11a (diff)
downloadmarkdown-cd752c06a6982effd530cd14924bc94459dcd043.tar.gz
markdown-cd752c06a6982effd530cd14924bc94459dcd043.tar.bz2
markdown-cd752c06a6982effd530cd14924bc94459dcd043.zip
Added footnote BACKLINK_TEXT test.
Diffstat (limited to 'tests')
-rw-r--r--tests/test_extensions.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/test_extensions.py b/tests/test_extensions.py
index a43de79..490d55b 100644
--- a/tests/test_extensions.py
+++ b/tests/test_extensions.py
@@ -932,3 +932,27 @@ Must not be confused with 'ndash' (--) ... >>
is the &sbquo;mdash&lsquo;: \u2014
Must not be confused with &sbquo;ndash&lsquo; (\u2013) \u2026 ]</p>"""
self.assertEqual(self.md.convert(text), correct)
+
+
+class TestFootnotes(unittest.TestCase):
+ """ Test Footnotes extension. """
+
+ def testBacklinkText(self):
+ md = markdown.Markdown(
+ extensions=['markdown.extensions.footnotes'],
+ extension_configs={'markdown.extensions.footnotes': {'BACKLINK_TEXT': 'back'}}
+ )
+ text = 'paragraph[^1]\n\n[^1]: A Footnote'
+ self.assertEqual(
+ md.convert(text),
+ '<p>paragraph<sup id="fnref:1"><a class="footnote-ref" href="#fn:1" rel="footnote">1</a></sup></p>\n'
+ '<div class="footnote">\n'
+ '<hr />\n'
+ '<ol>\n'
+ '<li id="fn:1">\n'
+ '<p>A Footnote&#160;<a class="footnote-backref" href="#fnref:1" rev="footnote"'
+ ' title="Jump back to footnote 1 in the text">back</a></p>\n'
+ '</li>\n'
+ '</ol>\n'
+ '</div>'
+ )