-
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
URLs with parentheses are not converting properly. #619
Comments
Definitely an issue, that I see happening across the web from users of marked. |
Is there an ETA for a fix on this ? |
I have no expectation that @chjj will ever fix this, but it's mostly a bug that stems from a bad assumption in https://github.com/chjj/marked/blob/master/lib/marked.js#L467, which is terminal: unless someone introduces a "respect nesting" operator to JavaScript's RegEx engine, it is impossible to user regular expressions in a way that properly deals with blocks/nesting. (which is why we typically don't parse structure syntax with regex, but with tokenizers instead) I was thinking of trying to fix this, but "fix" in this case means "write a new parser that doesn't rely on regex", and that's not happening. So: if you need links in which the URI contains |
filed #630 as PR to at least make it explicit that this is a pure RegEx parser, with all the limitations that brings with it. |
Using the following markup:
leads to a link that actually looks like
青 ("ao"))
with the link's own parenthesis getting cut off (marked seems to be treating the first)
it sees as link terminator, instead of taking nesting into account)The text was updated successfully, but these errors were encountered: