diff options
-rw-r--r-- | fabfile.py | 2 | ||||
-rw-r--r-- | markdown/extensions/attr_list.py | 4 | ||||
-rw-r--r-- | markdown/extensions/toc.py | 2 | ||||
-rw-r--r-- | tests/test_extensions.py | 26 |
4 files changed, 15 insertions, 19 deletions
@@ -10,7 +10,7 @@ from sys import platform def _get_versions(): """ Find and comfirm all supported versions of Python. """ vs = [] - for v in ['2.5', '2.6', '2.7', '3.1', '3.2']: + for v in ['2.6', '2.7', '3.1', '3.2', '3.3']: with settings( hide('warnings', 'running', 'stdout', 'stderr'), warn_only=True diff --git a/markdown/extensions/attr_list.py b/markdown/extensions/attr_list.py index d0d4873..7beaa6a 100644 --- a/markdown/extensions/attr_list.py +++ b/markdown/extensions/attr_list.py @@ -72,8 +72,8 @@ class AttrListTreeprocessor(Treeprocessor): INLINE_RE = re.compile(r'^%s' % BASE_RE) NAME_RE = re.compile(r'[^A-Z_a-z\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u02ff\u0370-\u037d' r'\u037f-\u1fff\u200c-\u200d\u2070-\u218f\u2c00-\u2fef' - r'\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd\u10000-\ueffff' - r'\-\.0-9\u00b7\u0300-\u036f\u203f-\u2040]+') + r'\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd' + r'\:\-\.0-9\u00b7\u0300-\u036f\u203f-\u2040]+') def run(self, doc): for elem in doc.getiterator(): diff --git a/markdown/extensions/toc.py b/markdown/extensions/toc.py index f50f11b..c672313 100644 --- a/markdown/extensions/toc.py +++ b/markdown/extensions/toc.py @@ -133,7 +133,7 @@ class TocTreeprocessor(Treeprocessor): used_ids = set() for c in doc.getiterator(): if "id" in c.attrib: - used_ids.append(c.attrib["id"]) + used_ids.add(c.attrib["id"]) toc_list = [] marker_found = False diff --git a/tests/test_extensions.py b/tests/test_extensions.py index d9d77b8..cb27a30 100644 --- a/tests/test_extensions.py +++ b/tests/test_extensions.py @@ -54,13 +54,11 @@ class TestCodeHilite(unittest.TestCase): text = '\t# A Code Comment' md = markdown.Markdown(extensions=['codehilite(linenums=True)']) if self.has_pygments: - self.assertEqual(md.convert(text), - '<table class="codehilitetable"><tr>' - '<td class="linenos"><div class="linenodiv"><pre>1</pre></div></td>' - '<td class="code"><div class="codehilite">' - '<pre><span class="c"># A Code Comment</span>\n</pre>' - '</div>\n</td>' - '</tr></table>') + # Differant versions of pygments output slightly different markup. + # So we use 'startwith' and test just enough to confirm that + # pygments received and processed linenums. + self.assertTrue(md.convert(text).startswith( + '<table class="codehilitetable"><tr><td class="linenos">')) else: self.assertEqual(md.convert(text), '<pre class="codehilite"><code class="linenums"># A Code Comment' @@ -96,13 +94,11 @@ class TestCodeHilite(unittest.TestCase): text = '\t#!Python\n\t# A Code Comment' md = markdown.Markdown(extensions=['codehilite(linenums=None)']) if self.has_pygments: - self.assertEqual(md.convert(text), - '<table class="codehilitetable"><tr>' - '<td class="linenos"><div class="linenodiv"><pre>1</pre></div></td>' - '<td class="code"><div class="codehilite">' - '<pre><span class="c"># A Code Comment</span>\n</pre>' - '</div>\n</td>' - '</tr></table>') + # Differant versions of pygments output slightly different markup. + # So we use 'startwith' and test just enough to confirm that + # pygments received and processed linenums. + self.assertTrue(md.convert(text).startswith( + '<table class="codehilitetable"><tr><td class="linenos">')) else: self.assertEqual(md.convert(text), '<pre class="codehilite"><code class="language-python linenums"># A Code Comment' @@ -416,4 +412,4 @@ class TestTOC(unittest.TestCase): '</ul>\n' '</li>\n' '</ul>\n' - '</div>\n')
\ No newline at end of file + '</div>\n') |