Skip to content

Commit

Permalink
Add one more test for the posmap extension
Browse files Browse the repository at this point in the history
  • Loading branch information
mitya57 committed Jun 5, 2018
1 parent 2b3ee1c commit d1a0aa3
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/test_posmap.py
Expand Up @@ -102,3 +102,17 @@ def test_highlightEmptyPython(self):
expected = markdown(text, extensions=self.extensionsNoPosMap)
self.assertIn('<div class="codehilite">', html)
self.assertMultiLineEqual(html, expected)

def test_traditionalCodeBlock(self):
text = dedent("""\
:::python
if __name__ == "__main__":
print("Hello, world!")
a paragraph following the code block, line 5
""")
extensions = [CodeHiliteExtension(), PosMapExtension()]
html = markdown(text, extensions=extensions)
self.assertNotIn('posmapmarker', html)
self.assertIn('<div class="codehilite">', html)
self.assertIn('<p data-posmap="5">', html)

0 comments on commit d1a0aa3

Please sign in to comment.