Message parser doesn't handle CRLF linebreaks #1847
Labels
area: backend
This issue involves Python, Django or dependency (eg. database)
bug
feature: parser
Parser converts markdown/bbcode strings into other forms
Milestone
Markup:
HTML result:
Expected result:
This happens because parser expects LF (
\n
) input and browsers send CRLF (\r\n
)We can fix this in two steps:
.replace("\r\n", "\n").replace("\r", "\n")
to normalize newlines before we send the string deeper into parser..replace("\n", "\r\n")
in reverse when rendering AST back to HTML/plaintext/etc.\n
with\r\n
on formatting help page.The text was updated successfully, but these errors were encountered: