diff --git a/tildes/tests/test_markdown.py b/tildes/tests/test_markdown.py index 90bdceb..e0be956 100644 --- a/tildes/tests/test_markdown.py +++ b/tildes/tests/test_markdown.py @@ -70,11 +70,7 @@ def test_deliberate_ordered_list(): def test_accidental_ordered_list(): """Ensure a common "accidental" ordered list gets escaped.""" - markdown = ( - "What year did this happen?\n\n" - "1975. It was a long time ago.\n\n" - "But I remember it like it was yesterday." - ) + markdown = "1975. It was a long time ago." html = convert_markdown_to_safe_html(markdown) assert " str: """Escape markdown that's probably an accidental ordered list. It's a common markdown mistake to accidentally start a numbered list, by beginning a - post or paragraph with a number followed by a period. For example, someone might try - to write "1975. It was a long time ago.", and the result will be a comment that says - "1. It was a long time ago." since that gets parsed into a numbered list. + post with a number followed by a period. For example, someone might try to write + "1975. It was a long time ago.", and the result will be a comment that says "1. It + was a long time ago." since that gets parsed into a numbered list. This fixes that quirk of markdown by escaping anything that would start a numbered - list except for "1. ". This will cause a few other edge cases, but I believe they're - less common/important than fixing this common error. + list at the beginning of a post, except for "1. ". """ return BAD_ORDERED_LIST_REGEX.sub(r"\1\\. ", markdown)