Esempio n. 1
0
    def test_it_adds_target_blank_and_rel_nofollow_to_links(self):
        actual = markdown.sanitize('<a href="https://example.org">Hello</a>')
        expected = '<a href="https://example.org" rel="nofollow noopener" target="_blank">Hello</a>'

        assert actual == expected
Esempio n. 2
0
 def test_it_escapes_evil_html(self, text, expected):
     assert markdown.sanitize(text) == expected
Esempio n. 3
0
    def test_it_allows_markdown_html(self, text, expected):
        if expected is None:
            expected = text

        assert markdown.sanitize(text) == expected
Esempio n. 4
0
    def test_it_adds_target_blank_and_rel_nofollow_to_links(self):
        actual = markdown.sanitize('<a href="https://example.org">Hello</a>')
        expected = '<a href="https://example.org" rel="nofollow noopener" target="_blank">Hello</a>'

        assert actual == expected
Esempio n. 5
0
 def test_it_escapes_evil_html(self, text, expected):
     assert markdown.sanitize(text) == expected
Esempio n. 6
0
    def test_it_allows_markdown_html(self, text, expected):
        if expected is None:
            expected = text

        assert markdown.sanitize(text) == expected