-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
Additional empty line in syntax-highlighted code fences when using Windows line endings #6596
Comments
To add to the above report, the issue doesn't happen with every code highlight. C# and Go, for example, work fine with CRLF and LF line endings. Unfortunately a lot of other languages are problematic. Because the issue still happens with Hugo 0.62.2, I've made an example repository here. There are two content files in there. One intended to use LF line endings, the other CRLF. If someone runs that example website with I hope this issue can be fixed since it's confusing to the less-technical people I work with. Plus it even confuses me sometimes because the issue doesn't happen with every kind of code example. Would perhaps a simple |
Recreate gohugoio#7027 Fixes gohugoio#6596
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
What version of Hugo are you using (
hugo version
)?Does this issue reproduce with the latest release?
Yes.
How to reproduce
Create a new document with a code block using synatx highlighting, e.g.
Make sure this file is stored using Windows line endings.
Generate HTML
Expected behaviour
HTML should be rendered which looks something like
Observed behaviour
When using Windows line endings, an additional empty line is printed -- but only for the comment! I.e. I see
Additional notes
It appears that when using Windows line endings, any comment in syntax-highlighted code fences (at least for Python and Perl) gets an additional empty line appended.
The text was updated successfully, but these errors were encountered: