aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_extensions.py
diff options
context:
space:
mode:
authorWaylan Limberg <waylan@gmail.com>2013-07-28 15:09:25 -0400
committerWaylan Limberg <waylan@gmail.com>2013-07-28 15:09:25 -0400
commita4ceb0b2a5f2c2ae8aa3981182cf829fdd28e840 (patch)
tree8f1b55691e95a91ccc010bb5f95f33383bf862e8 /tests/test_extensions.py
parentdf8423b93eb11fede3a8eeae416e5985ffab64da (diff)
downloadmarkdown-a4ceb0b2a5f2c2ae8aa3981182cf829fdd28e840.tar.gz
markdown-a4ceb0b2a5f2c2ae8aa3981182cf829fdd28e840.tar.bz2
markdown-a4ceb0b2a5f2c2ae8aa3981182cf829fdd28e840.zip
HeaderID Ext now handles raw html in ids. Fixes #232
Diffstat (limited to 'tests/test_extensions.py')
-rw-r--r--tests/test_extensions.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/test_extensions.py b/tests/test_extensions.py
index 4eb600b..add759a 100644
--- a/tests/test_extensions.py
+++ b/tests/test_extensions.py
@@ -236,6 +236,18 @@ class TestHeaderId(unittest.TestCase):
'<h1 id="some-header-with-markup">Some <em>Header</em> with '
'<a href="http://example.com">markup</a>.</h1>')
+ def testHtmlEntities(self):
+ """ Test HeaderIDs with HTML Entities. """
+ text = '# Foo &amp; bar'
+ self.assertEqual(self.md.convert(text),
+ '<h1 id="foo-bar">Foo &amp; bar</h1>')
+
+ def testRawHtml(self):
+ """ Test HeaderIDs with raw HTML. """
+ text = '# Foo <b>Bar</b> Baz.'
+ self.assertEqual(self.md.convert(text),
+ '<h1 id="foo-bar-baz">Foo <b>Bar</b> Baz.</h1>')
+
def testNoAutoIds(self):
""" Test HeaderIDs with no auto generated IDs. """