matcornic / hugo-theme-learn

Porting Grav Learn theme to Hugo
https://learn.netlify.com/en/
MIT License
1.61k stars 1.28k forks source link

New lines added after Python comments #385

Open ttnny opened 4 years ago

ttnny commented 4 years ago

Is there anyone experiencing the issue that a new line is added after every Python comment? It is just for Python specifically, not other languages. I tried updating the highlight.js to the newest version but it didn't solve the issue.

Markdown:

```py
a_set = {1, 2, 3, 4, 5, 5}
a_set.add(99)
a_set.add(3)

# print {1, 2, 3, 4, 5, 99}
print(a_set)


Display:

![display](https://user-images.githubusercontent.com/3998614/76694360-eaadaa00-662e-11ea-8eba-e68b8b4e5204.PNG)
fritzmg commented 4 years ago

I see that happening in PHP comments too, but only in my local Windows environment. When building with GitHub actions under a Linux VM, everything is fine, oddly. Both environments use Hugo 0.67.0.

matalo33 commented 4 years ago

Is this rendering not purely the responsibility of highlight? Or is there some CSS style from the theme bleeding over into rendered code blocks?

fritzmg commented 4 years ago

As far as I can tell this happens only with a file containing CRLF line breaks, rather than LF (e.g. on Windows).