Skip to content
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

Extraneous spaces? #115

Closed
crides opened this issue Dec 23, 2019 · 2 comments
Closed

Extraneous spaces? #115

crides opened this issue Dec 23, 2019 · 2 comments

Comments

@crides
Copy link

crides commented Dec 23, 2019

When using glow to render markdowns, it seems like there are a lot of useless spaces at the end of lines. You can see in this screenshot (run with glow github.com/charmbracelet/glow | bat -A, where the blue dots are spaces):

maim-2019-12-23--14-35-38

@muesli
Copy link
Member

muesli commented Dec 23, 2019

Correct. This seems pointless when you're using the default style that doesn't use background colors, but it makes a difference with different styles. Consider this example:

image

I think we can try and trim padding spaces when there's no background color being applied.

Btw, if you're using glow/glamour to pipe its output to a pager, I'd also recommend explicitly setting a style, otherwise it'll detect not printing to a terminal and switch to the notty style.

@muesli muesli transferred this issue from charmbracelet/glamour Dec 25, 2019
@muesli
Copy link
Member

muesli commented Dec 25, 2019

I've moved this issue to glow, as I don't consider it a bug in the context of glamour. Here the padding indeed is an intended feature.

However, I can understand why in the context of glow this might not be the desired effect, if the padding itself isn't styled - for example when background colors are being applied.

I've therefore fixed this in glow itself and we now trim un-styled spaces from the end of each line.

@muesli muesli closed this as completed Dec 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants