aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorStephan Groß <stephan@minddust.com>2016-03-17 14:03:07 +0000
committerStephan Groß <stephan@minddust.com>2016-03-17 14:03:07 +0000
commit935d55bc1320612bf7f2e46c3510f43eb0531108 (patch)
treebab194bc7b29d738fa11c05fc6f59072a8002000 /tests
parent08d81b0e1e38b7662d4a8837c1b6a229b7082482 (diff)
downloadmarkdown-935d55bc1320612bf7f2e46c3510f43eb0531108.tar.gz
markdown-935d55bc1320612bf7f2e46c3510f43eb0531108.tar.bz2
markdown-935d55bc1320612bf7f2e46c3510f43eb0531108.zip
Add failing toc test
Diffstat (limited to 'tests')
-rw-r--r--tests/test_extensions.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/test_extensions.py b/tests/test_extensions.py
index 6d47e0e..a5b739e 100644
--- a/tests/test_extensions.py
+++ b/tests/test_extensions.py
@@ -775,6 +775,21 @@ class TestTOC(TestCaseWithAssertStartsWith):
'<h2 id="header-2"><a class="toclink" href="#header-2">Header <em>2</em></a></h2>'
)
+ def testAnchorLinkWithInlineCode(self):
+ """ Test TOC Anchorlink with inline code. """
+ md = markdown.Markdown(
+ extensions=[markdown.extensions.toc.TocExtension(anchorlink=True)]
+ )
+ text = '# This is `code` and `this` too.'
+ self.assertEqual(
+ md.convert(text),
+ '<h1 id="this-is-code-and-this-too">' # noqa
+ '<a class="toclink" href="#this-is-code-and-this-too">' # noqa
+ 'This is <code>code</code> and <code>this</code> too.' # noqa
+ '</a>' # noqa
+ '</h1>' # noqa
+ )
+
def testTitle(self):
""" Test TOC Title. """
md = markdown.Markdown(