aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorWaylan Limberg <waylan.limberg@icloud.com>2015-02-05 22:23:52 -0500
committerWaylan Limberg <waylan.limberg@icloud.com>2015-02-05 22:23:52 -0500
commit9f6b45f8944a2d91041e941da609e5ac09373e22 (patch)
treeb61016122f7b8d35257b4619f5cb259c202c2498 /tests
parent75855cdcca179f2a332bddfc4ea7c9730f701360 (diff)
downloadmarkdown-9f6b45f8944a2d91041e941da609e5ac09373e22.tar.gz
markdown-9f6b45f8944a2d91041e941da609e5ac09373e22.tar.bz2
markdown-9f6b45f8944a2d91041e941da609e5ac09373e22.zip
Added a 'use_pygments' config option to CodeHilite.
Fixes #386. I'm doing this against my better judgement. The only reason is that I'm using the HTML format suggested by the HTML5 Spec and will simply not consider any alternate output. If a JavaScript library requires something else, to bad. I don't care. That library should support the format suggested by the spec or I'm not interested in it. If you want something else then you can create your own extension which does whatever you want.
Diffstat (limited to 'tests')
-rw-r--r--tests/test_extensions.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/test_extensions.py b/tests/test_extensions.py
index 6642921..6a57878 100644
--- a/tests/test_extensions.py
+++ b/tests/test_extensions.py
@@ -226,6 +226,17 @@ class TestCodeHilite(unittest.TestCase):
'#line 3</code></pre>'
)
+ def testUsePygmentsFalse(self):
+ text = '\t:::Python\n\t# A Code Comment'
+ md = markdown.Markdown(
+ extensions=[markdown.extensions.codehilite.CodeHiliteExtension(use_pygments=False)]
+ )
+ self.assertEqual(
+ md.convert(text),
+ '<pre class="codehilite"><code class="language-python"># A Code Comment'
+ '</code></pre>'
+ )
+
class TestFencedCode(unittest.TestCase):
""" Test fenced_code extension. """