aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_extensions.py
diff options
context:
space:
mode:
authorWaylan Limberg <waylan@gmail.com>2012-12-13 14:47:34 -0500
committerWaylan Limberg <waylan@gmail.com>2012-12-13 14:47:34 -0500
commitf52d62656705841316d1d653644d874b4db9ff37 (patch)
tree01a77f09db092848ab91b76e2230aafd01e8e8d7 /tests/test_extensions.py
parenta8e06b7cef5c5b0b372b9a0db0f56c4e7094e2bd (diff)
downloadmarkdown-f52d62656705841316d1d653644d874b4db9ff37.tar.gz
markdown-f52d62656705841316d1d653644d874b4db9ff37.tar.bz2
markdown-f52d62656705841316d1d653644d874b4db9ff37.zip
Fixed #165. Switched the order of treeprocessors when attr_list and headerid extensions are used togeather. While this means headerid may alter IDs defined in attr_lists for uniqueness, automaticaly generated ids will not contain unparsed attr_lists. This is the lesser of two evils - and actually generates a more valid output (all IDs will be unique)
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 315e7ef..b10414e 100644
--- a/tests/test_extensions.py
+++ b/tests/test_extensions.py
@@ -171,6 +171,18 @@ header_forceid: Off
self.assertEqual(markdown.markdown(text, ['headerid', 'meta']),
'<h2>A Header</h2>')
+ def testHeaderIdWithAttr_List(self):
+ """ Test HeaderIDs with Attr_List extension. """
+
+ text = '# Header1 {: #foo }\n# Header2 {: .bar }'
+ self.assertEqual(markdown.markdown(text, ['headerid', 'attr_list']),
+ '<h1 id="foo">Header1</h1>\n'
+ '<h1 class="bar" id="header2">Header2</h1>')
+ # Switch order extensions are loaded - should be no change in behavior.
+ self.assertEqual(markdown.markdown(text, ['attr_list', 'headerid']),
+ '<h1 id="foo">Header1</h1>\n'
+ '<h1 class="bar" id="header2">Header2</h1>')
+
class TestMetaData(unittest.TestCase):
""" Test MetaData extension. """