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

Wrong rendering assumption when using @ in markdown files #228

Open
marcelarie opened this issue Feb 24, 2023 · 4 comments · May be fixed by #261
Open

Wrong rendering assumption when using @ in markdown files #228

marcelarie opened this issue Feb 24, 2023 · 4 comments · May be fixed by #261
Labels
bug Something isn't working

Comments

@marcelarie
Copy link

glow version 1.5.0

I found a difference between bat and glow, and I think that bat has the correct output on this one. Seems that glow assumes that any two strings separated by a @ are a mail address.

Here is an example of the bat output:
Screenshot 2023-02-24 at 23 58 31

Here is an example of the glow output:
Screenshot 2023-02-24 at 23 58 41

You can see how the mailto: link is generated.

This is the content of the file:

@bashbunni
Copy link
Member

@marcelarie Good catch! Thank you for reporting this. I'm going to move this over to Glamour, the markdown rendering library that handles the markdown rendering under the hood in Glow. I'll be sure to bring it to the attention of the team.

@bashbunni bashbunni transferred this issue from charmbracelet/glow Apr 20, 2023
@bashbunni bashbunni added the bug Something isn't working label Apr 20, 2023
@marcelarie
Copy link
Author

marcelarie commented Apr 20, 2023

Cool, thanks!

@caarlos0
Copy link
Member

FWIW: one workaround (for now) would be to put it inside a codeblock

@bashbunni
Copy link
Member

I looked into this; it seems to be consistent with other markdown renderers. It's our upstream dependency goldmark that's autolinking email addresses if it matches the HTML5 regex in the CommonMark Spec.

I wrote some tests to reproduce the behaviour you're experiencing in Goldmark. Based on their note in their issue template, I don't think they're going to change how they're handling emails. We might consider how we want to handle the type we get back from the autolinking... I'll discuss with the team to see what they think :)

@bashbunni bashbunni linked a pull request Oct 3, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants