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