Beispiel #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
Beispiel #2
0
 def test_it_escapes_evil_html(self, text, expected):
     assert markdown.sanitize(text) == expected
Beispiel #3
0
    def test_it_allows_markdown_html(self, text, expected):
        if expected is None:
            expected = text

        assert markdown.sanitize(text) == expected
Beispiel #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
Beispiel #5
0
 def test_it_escapes_evil_html(self, text, expected):
     assert markdown.sanitize(text) == expected
Beispiel #6
0
    def test_it_allows_markdown_html(self, text, expected):
        if expected is None:
            expected = text

        assert markdown.sanitize(text) == expected