You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I can't find any authoritative answers from CommonMark either. I used to replace \r\n line endings with \n in Document.__init__, but stopped doing so after I discovered that Python's open function automatically normalizes line endings. See the documentation on open's newline parameter.
Is there a reason you would want to pass in raw strings with CRLF line-endings to mistletoe? It is an easy fix--I just need to add one line in Document.__init__, but it will incur some performance cost where the normalization is otherwise not needed.
When creating a post, the data from the textarea (which is then sent to mistletoe) seems to come with \r\n instead of just \n.
Unfortunately, I don't have enough insights to know who's the culprit here (the HTTP spec? Some Python library used by the project?).
Either way, it is trivial for consumers to fix that (I did just that JD557/microblog.pub#63) but, as you mentioned, it would be nice to have this behavior documented somewhere
When
\r\n
is used for line endings, the behaviour can be a bit surprising:I stumbled on this today and I thought I'd report it. Not sure what the correct behaviour should be though. I only found it mentioned here: https://talk.commonmark.org/t/carriage-returns-and-code-blocks/2519
The text was updated successfully, but these errors were encountered: