diff --git a/tildes/tests/test_markdown.py b/tildes/tests/test_markdown.py index e11d8b3..c56951b 100644 --- a/tildes/tests/test_markdown.py +++ b/tildes/tests/test_markdown.py @@ -36,13 +36,30 @@ def test_basic_markdown_unescaped(): def test_strikethrough(): """Ensure strikethrough works and doesn't turn into a group link.""" - markdown = "This ~should not~ should work" + markdown = "This ~~should not~~ should work" processed = convert_markdown_to_safe_html(markdown) assert "" in processed assert "" not in processed + + +def test_strikethrough_with_group(): + """Ensure strikethrough works with a group name in the middle.""" + markdown = "They ~~spammed ~music heavily~~ posted lots of songs." + processed = convert_markdown_to_safe_html(markdown) + + assert processed.count("") == 1 + assert " tag doesn't get linked.""" - markdown = "Strikethrough works like: `this ~should not~ work`." + markdown = "Link to a group by just writing its name: `see ~news for more`." processed = convert_markdown_to_safe_html(markdown) assert "