charmbracelet / glamour

Stylesheet-based markdown rendering for your CLI apps 💇🏻‍♀️
MIT License
2.47k stars 181 forks source link

disable trailing space highlighting in code blocks #240

Open AlJohri opened 1 year ago

AlJohri commented 1 year ago

Is your feature request related to a problem? Please describe. I find the bright pink trailing space highlighting very distracting. Example:

wget https://github.com/hyperium/tonic/raw/master/examples/helloworld-tutorial.md
glow helloworld-tutorial.md
Screenshot 2023-06-18 at 12 12 38 PM

Describe the solution you'd like I expect to be able to render Markdown files like I would see them out in the wild on Github without the distracting highlighting for trailing spaces in code blocks. For example this is how helloworld-tutorial.md renders on Github.

Describe alternatives you've considered alternative would be to to trim the file myself, but I expect to be able to read existing markdown files created by other people out of the box

bashbunni commented 1 year ago

Thanks for bringing this to our attention! I'm going to move it to our markdown rendering library so we can make sure it gets addressed in the upstream dependency.

bashbunni commented 1 year ago

fwiw this is happening because the trailing spaces are being rendered with GenericDeleted styles