Skip to content

Commit

Permalink
Make TestCodeHilite work with Pygments ≥ 2.1.1
Browse files Browse the repository at this point in the history
New versions of Pygments insert <span></span> blocks in the beginning
of the generated output sometimes [1], so we need to remove those blocks
before doing the actual checking.

[1]: https://bitbucket.org/birkenfeld/pygments-main/commits/164574c13533
  • Loading branch information
mitya57 committed Mar 3, 2016
1 parent 06958b1 commit 08d81b0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/test_extensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ def testHighlightLinesWithColon(self):
if self.has_pygments:
self.assertStartsWith(
'<div class="codehilite"><pre><span class="hll"',
md.convert(text)
md.convert(text).replace('<span></span>', '')
)
else:
self.assertEqual(
Expand Down Expand Up @@ -330,7 +330,7 @@ def testFencedCodeWithHighlightLines(self):
if self.has_pygments:
self.assertStartsWith(
'<div class="codehilite"><pre><span class="hll"',
md.convert(text)
md.convert(text).replace('<span></span>', '')
)
else:
self.assertEqual(
Expand Down Expand Up @@ -365,7 +365,7 @@ def testFencedLanguageAndHighlightLines(self):
if self.has_pygments:
self.assertStartsWith(
'<div class="codehilite"><pre><span class="hll"',
md.convert(text)
md.convert(text).replace('<span></span>', '')
)
else:
self.assertEqual(
Expand Down

0 comments on commit 08d81b0

Please sign in to comment.