1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
|
"""Test cases for BetterEm."""
from .. import util
class TestEscapeAll(util.MdCase):
"""Test escaping cases."""
extension = [
'pymdownx.escapeall'
]
extension_configs = {}
def test_html_special_char_lt(self):
"""Test `<`."""
self.check_markdown(
r'\<pre>foo',
'<p><pre>foo</p>'
)
def test_html_special_char_gt(self):
"""Test `>`."""
self.check_markdown(
r'<span\>foo',
'<p><span>foo</p>'
)
def test_html_special_char_amp(self):
"""Test `&`."""
self.check_markdown(
r'This \& that',
'<p>This & that</p>'
)
def test_normal_escape(self):
"""Test normal escapes."""
self.check_markdown(
r'This & \that',
'<p>This & that</p>'
)
|