aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_extensions.py
diff options
context:
space:
mode:
authorTiago Serafim <tserafim@gmail.com>2013-02-09 16:51:17 -0200
committerTiago Serafim <tserafim@gmail.com>2013-02-09 17:39:12 -0200
commit14f43d5a4c91ac13528f4c9eb8c6247fdafb0ea1 (patch)
treeedcb6d7462d31d66dcc792ed5e84373187b1de14 /tests/test_extensions.py
parent6c15c64df40b9ded3f5dea2e694905222791c1b6 (diff)
parent41cc055580d63ffb7eb2bbb6c88e121727d91d06 (diff)
downloadmarkdown-14f43d5a4c91ac13528f4c9eb8c6247fdafb0ea1.tar.gz
markdown-14f43d5a4c91ac13528f4c9eb8c6247fdafb0ea1.tar.bz2
markdown-14f43d5a4c91ac13528f4c9eb8c6247fdafb0ea1.zip
Merge branch 'master' into admonition
Conflicts: docs/extensions/index.txt tests/extensions/test.cfg
Diffstat (limited to 'tests/test_extensions.py')
-rw-r--r--tests/test_extensions.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/tests/test_extensions.py b/tests/test_extensions.py
index 7661347..fd77e5e 100644
--- a/tests/test_extensions.py
+++ b/tests/test_extensions.py
@@ -7,6 +7,7 @@ continue to work as advertised. This used to be accomplished by doctests.
"""
+from __future__ import unicode_literals
import unittest
import markdown
@@ -47,7 +48,7 @@ class TestCodeHilite(unittest.TestCase):
'</pre></div>')
else:
self.assertEqual(self.md.convert(text),
- '<pre><code>Code\n'
+ '<pre class="codehilite"><code># A Code Comment'
'</code></pre>')
@@ -171,6 +172,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. """