-
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
Incompatibility between links wrapped in asterisks, pedantic, and GFM #1410
Comments
Thanks this looks like a bug. Compare the output from marked with the output from commonmark. The workaround is to use |
@styfle I think wrapping up your links with asterisks as pretty common, because that's the only way the editors can apply the correct style to that link. I only use HTML tags in my markdown documents as a last resort. |
Agreed, this is a bug 👍 Would you like to submit a PR to fix it? 😃 |
Well, you got me! I'm not familiar with this library, but I have a browser extension that can be used as a constant source of annoyances for you. 😄 |
related to #1284 |
It appears to be something wrong with this regex https://github.com/markedjs/marked/blob/master/lib/marked.js#L545 I'll see if I can fix it today. |
@x13machine The problem is that an so <p><em><a href="url">link*</a></em></p> not <p><em>[link</em>](url)*</p> but <p><em>[link</em>](url*</p> so after finding an ending |
so the regex should replace with a function? |
It should be something like the way we check for nested parentheses in a link #1414. The regex should grab more than it needs if the end is in square brackets or parentheses then the lexer will run it through a function and find the actual end. |
Why does group 3 match |
ya the regex doesn't treat |
A very similar problem is still here ("marked": "^0.7.0"):
The Thanks for looking! |
The second error can be reproduced in the editor |
Closing this since all of the cases in the OP appear to be working correctly now as of , as well as the later issue by @crystalfp. |
Fix `<em>` issue with mixed content markedjs#1410
Describe the bug
I have a named link, that I want wrapped in asterisks, essentially making it italic.
To Reproduce
The offending lines are:
Enabling the
pedantic
option fixes this issue, but at the same time it breaks lots of other stuff, like GFM tables and strikethrough. Also note that I only tested with named links, but it may be broken for other types of links as well.Expected behavior
Well, I'm looking at the exact same example using Remark - another popular parser, that I think was forked out of Marked back then, and everything renders correctly.
Let me know if I need to provider more information.
The text was updated successfully, but these errors were encountered: