-
Notifications
You must be signed in to change notification settings - Fork 186
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
Add option to disable auto email mailto:
links
#261
base: master
Are you sure you want to change the base?
Conversation
@@ -227,6 +227,13 @@ func (tr *ANSIRenderer) NewElement(node ast.Node, source []byte) Element { | |||
u := string(n.URL(source)) | |||
label := string(n.Label(source)) | |||
if n.AutoLinkType == ast.AutoLinkEmail && !strings.HasPrefix(strings.ToLower(u), "mailto:") { | |||
if tr.context.options.DisableAutoEmailLinks { | |||
return Element{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, thanks for the contribution! This is a feature I know people are interested in.
One thing to keep in mind is this also strips the link styling of anything that looks like an email. Do we want to keep the ability to style these components with custom styles? Would be great to hear your thoughts :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😄 Thank you for the review!
For my own use case, I would prefer to just remove the styling for anything that looks like an email. But, I can totally see other people's use case where they want to modify the style instead.
Happy to modify this PR if you think we should not just disable email auto links, but allow them to be disabled or otherwise manipulated through a custom style. But, I might need a little more time to get that sorted out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👋 @bashbunni, just wanted to follow up on this again. Should I try to update this PR to keep the ability to style these components?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @picatz I'm going to leave it open for now, I'm currently doing a big refactor of glamour, so will take a look again once that's done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Understood, thank you for the update!
Thank you for approving @caarlos0! @bashbunni, @aymanbagabas is there anything else needed from this PR? |
Hi @picatz, thank you for working on this. Please see my comment here |
Thanks for the quick reply @aymanbagabas. I guess I was a little confused, seeing @caarlos0's approval this morning. 😄 I have two follow up questions: 1. Should this PR be closed in favor of the proposed 2. Should a new issue be created that captures the |
oh, that's my bad, I hadn't seen that other issue |
No worries @caarlos0, totally understand! 😄 |
Yes, once we have a new PR for
That would be helpful! |
This PR aims to fix #260 and #82 by adding an option to disable auto email
mailto:
links.