From 2afcb216ea0318a28a6c1951053eed74e96e3aec Mon Sep 17 00:00:00 2001 From: Deimos Date: Mon, 13 Aug 2018 17:23:49 -0600 Subject: [PATCH] Skip tags when linkifying groups/users --- tildes/tests/test_markdown.py | 8 ++++++++ tildes/tildes/lib/markdown.py | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/tildes/tests/test_markdown.py b/tildes/tests/test_markdown.py index 5ac9979..90bdceb 100644 --- a/tildes/tests/test_markdown.py +++ b/tildes/tests/test_markdown.py @@ -338,3 +338,11 @@ def test_username_ref_inside_pre_ignored(): processed = convert_markdown_to_safe_html(markdown) assert " tag doesn't get linked.""" + markdown = "Strikethrough works like: `this ~should not~ work`." + processed = convert_markdown_to_safe_html(markdown) + + assert " str: def postprocess_markdown_html(html: str) -> str: """Apply post-processing to HTML generated by markdown parser.""" # list of tag names to exclude from linkification - linkify_skipped_tags = ["pre"] + linkify_skipped_tags = ["code", "pre"] # search for text that looks like urls and convert to actual links html = bleach.linkify(