New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Windows-style line endings break rendering #329
Comments
I confirm the problem. Text obtain from a textarea html form has its lines terminated by \r\n. A filtering is required to replace \r\n with \n. |
Can someone try #336? Given there's no data to verify that this fixes the issue, I'd prefer someone to verify it before merging. |
@alecthomas This is pretty much the workaround I use locally, at the moment. I'm actually wondering if it needs to be a separate option or if this isn't a sanitizer we always want to run? |
I am wondering, too. @muesli Theoretically, there can be lexers which do not handle |
Fix merged please verify. |
@alecthomas Verified as fixed. Thanks everyone! |
* Add new TokeniseOption EnsureLF ref alecthomas#329 * Use efficient process suggested by @chmike
Windows-style line endings
\r\n
break chroma's syntax highlighting. I've seen it break in different ways, but most commonly it will then render everything as spaces instead of text.Providing a copyable text is difficult, as the GitHub interface would cleanup the line endings. GitHub also doesn't let me attach such a file to this issue.
Replacing
\r\n
and\r
with\n
before passing the source to chroma works around the problem.The text was updated successfully, but these errors were encountered: