removes a line that broke hard line brakes intentionally to fix Markdown implementation fails to produce hard line breaks properly #440 (#591)

This commit is contained in:
rudyon 2023-07-13 20:16:40 +03:00 committed by GitHub
parent 231c0f420f
commit d3ea7b510e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -184,9 +184,6 @@ def sanitize_raw(sanitized:Optional[str], allow_newlines:bool, length_limit:Opti
@with_gevent_timeout(2)
def sanitize(sanitized, alert=False, comment=False, edit=False):
# double newlines, eg. hello\nworld becomes hello\n\nworld, which later becomes <p>hello</p><p>world</p>
sanitized = linefeeds_regex.sub(r'\1\n\n\2', sanitized)
if MULTIMEDIA_EMBEDDING_ENABLED:
# turn eg. https://wikipedia.org/someimage.jpg into ![](https://wikipedia.org/someimage.jpg)
sanitized = image_regex.sub(r'\1![](\2)\4', sanitized)