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