-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Emphasized URL with underscores #872
Comments
note: marked is sticky @0.3.3 because of issue #872 – markedjs/marked#872
came to file this same bug/regression. current test was @ 0.3.6 ... will move back to 0.3.3 it seems. |
I'll just say that this is due to a change to the @@ -454,7 +456,7 @@ var inline = {
reflink: /^!?\[(inside)\]\s*\[([^\]]*)\]/,
nolink: /^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,
strong: /^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,
- em: /^\b_((?:__|[\s\S])+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,
+ em: /^\b_((?:[^_]|__)+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,
code: /^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,
br: /^ {2,}\n(?!\s*$)/,
del: noop, First of all, autolinking of plain URLs is GFM matter. Markdown (commonmark) allows autolinking of URIs wrapped inside
gets parsed to
and this is not correct. This is a tricky one. Whenever underscores are present in URLs, it is advisable to use reflinks. |
@joshbruce I would re-open this one and put it under category 'emphasize'. |
@Feder1co5oave: Re-opening. Putting under "links" for now. Would like avoid creating a category for individual HTML elements. That's why we have "lists" instead of "description lists", yeah? Maybe inline and block would make sense as categories as well. I only created the initial categories because there were more than 5 or 6 issues revolving around that topic. |
this seems to be fixed in the latest version of marked. demo |
After upgrading marked from 0.3.3 to 0.3.4 I noticed a different output for the following call:
This is was I got so far in marked 0.3.3 – which is also what I would expect:
https://reddit.com/r/science/comments/5yde1e/its_official_time_crystals_are_a_new_state_of/
However, in marked 0.3.4 and greater the output becomes this:
_https://reddit.com/r/science/comments/5yde1e/its_official_time_crystals_are_a_new_state_of/_
Please also note that Github’s markdown implementation behaves like 0.3.3:
https://reddit.com/r/science/comments/5yde1e/its_official_time_crystals_are_a_new_state_of/
The text was updated successfully, but these errors were encountered: