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

Autolink breaks mailto links when wrapped in styling syntax #1327

Closed
destroytoday opened this issue Aug 29, 2018 · 2 comments
Closed

Autolink breaks mailto links when wrapped in styling syntax #1327

destroytoday opened this issue Aug 29, 2018 · 2 comments
Labels
category: links L1 - broken Valid usage causes incorrect output OR a crash AND there is no known workaround for the issue

Comments

@destroytoday
Copy link

destroytoday commented Aug 29, 2018

In versions v0.3.14 and up, when wrapping an email address with styling syntax (*, **, _, etc), Marked includes the opening syntax in the email address, which prevents styling. ex: **me@example.com** renders <a href='mailto:**me@example.com'>**me@example.com</a>**

Steps to reproduce the behavior:

  1. Install any version of Marked from v0.3.14 until latest (npm install marked)
  2. Wrap an email address in bold or italic syntax (**me@example.com**)
  3. Render with Marked (var marked = require('marked'); marked('**me@example.com**'))
  4. Actual output is <a href='mailto:**me@example.com'>**me@example.com</a>**

Expected behavior
Marked should properly style the email address and extract it correctly for the mailto link: <strong><a href='mailto:me@example.com'>me@example.com</a></strong>

@UziTech UziTech added L1 - broken Valid usage causes incorrect output OR a crash AND there is no known workaround for the issue category: links labels Aug 29, 2018
@UziTech
Copy link
Member

UziTech commented Aug 29, 2018

confirmed

demo

@styfle
Copy link
Member

styfle commented Aug 30, 2018

Related #1307

Feder1co5oave added a commit to Feder1co5oave/marktex that referenced this issue Sep 18, 2018
davidjb added a commit to davidjb/sequelize that referenced this issue Oct 2, 2019
These were previously being rendered via esdoc (which uses marked's
autolink rendering) as `mailto:` links.  There are some
[suggestions](https://gist.github.com/alexpeattie/4729247) about how one
might disable or avoid autolinking but in this case the package
identifiers are in backticks, producing weird behaviour similar to
markedjs/marked#1327.

Assuming the fix attached to this latter issue applied in this case,
then a dependency upgrade of `marked` within `esdoc` might solve the
problem, but there are [maintenance
issues](esdoc/esdoc#543) there.

Until that arrives, this is a workaround to avoiding the weird `mailto:`
links on this page.
davidjb added a commit to davidjb/sequelize that referenced this issue Oct 2, 2019
These were previously being rendered via esdoc (which uses marked's
autolink rendering) as `mailto:` links.  There are some
[suggestions](https://gist.github.com/alexpeattie/4729247) about how one
might disable or avoid autolinking but in this case the package
identifiers are in backticks, producing weird behaviour similar to
markedjs/marked#1327.

Assuming the fix attached to this latter issue applied in this case,
then a dependency upgrade of `marked` within `esdoc` might solve the
problem, but there are [maintenance
issues](esdoc/esdoc#543) there.

Until that arrives, this is a workaround to avoiding the weird `mailto:`
links on this page.
zhenalexfan pushed a commit to zhenalexfan/MarkdownHan that referenced this issue Nov 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: links L1 - broken Valid usage causes incorrect output OR a crash AND there is no known workaround for the issue
Projects
None yet
Development

No branches or pull requests

3 participants