diff options
author | Waylan Limberg <waylan.limberg@icloud.com> | 2017-03-08 19:03:27 -0500 |
---|---|---|
committer | Waylan Limberg <waylan.limberg@icloud.com> | 2017-03-08 19:03:27 -0500 |
commit | cd752c06a6982effd530cd14924bc94459dcd043 (patch) | |
tree | feabac28a76f2e096caa6d54bc3593564764f91a | |
parent | fd4d1d2183b6f1f41445ba0461799da71adfb11a (diff) | |
download | markdown-cd752c06a6982effd530cd14924bc94459dcd043.tar.gz markdown-cd752c06a6982effd530cd14924bc94459dcd043.tar.bz2 markdown-cd752c06a6982effd530cd14924bc94459dcd043.zip |
Added footnote BACKLINK_TEXT test.
-rw-r--r-- | tests/test_extensions.py | 24 |
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 ‚mdash‘: \u2014 Must not be confused with ‚ndash‘ (\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 <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>' + ) |