File: test_escapeall.py

package info (click to toggle)
pymdown-extensions 10.13-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 7,104 kB
  • sloc: python: 60,117; javascript: 846; sh: 8; makefile: 5
file content (43 lines) | stat: -rw-r--r-- 886 bytes parent folder | download | duplicates (2)
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>&lt;pre&gt;foo</p>'
        )

    def test_html_special_char_gt(self):
        """Test `>`."""

        self.check_markdown(
            r'<span\>foo',
            '<p>&lt;span&gt;foo</p>'
        )

    def test_html_special_char_amp(self):
        """Test `&`."""

        self.check_markdown(
            r'This \& that',
            '<p>This &amp; that</p>'
        )

    def test_normal_escape(self):
        """Test normal escapes."""

        self.check_markdown(
            r'This & \that',
            '<p>This &amp; that</p>'
        )