From cd752c06a6982effd530cd14924bc94459dcd043 Mon Sep 17 00:00:00 2001 From: Waylan Limberg Date: Wed, 8 Mar 2017 19:03:27 -0500 Subject: Added footnote BACKLINK_TEXT test. --- tests/test_extensions.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) 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 ]

""" 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), + '

paragraph1

\n' + '
\n' + '
\n' + '
    \n' + '
  1. \n' + '

    A Footnote back

    \n' + '
  2. \n' + '
\n' + '
' + ) -- cgit v1.2.1