-
-
Notifications
You must be signed in to change notification settings - Fork 226
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
Parsing emphasis takes quadratic time #172
Comments
Note: cmark does NOT have this problem (nor does jgm/commonmark-hs). |
I think this is the same as commonmark/cmark#178 It should be possible to port this commit to commonmark.js, which otherwise follows cmark's algorithm exactly. |
I backported the fix to cmark#178, but that didn't fix this case. |
jgm
added a commit
that referenced
this issue
Aug 30, 2019
taku0
added a commit
to taku0/cmark-el
that referenced
this issue
Dec 28, 2019
Closes commonmark/commonmark.js#172. commonmark/commonmark.js@a45a752 Author: John MacFarlane <[email protected]> Date: Fri Aug 30 17:11:45 2019 -0700
rpokorny
added a commit
to rpokorny/react-commonmark
that referenced
this issue
Jan 4, 2021
The old version, 0.27.0, has a vulnerability as described here: commonmark/commonmark.js#172
This was referenced Jan 4, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A bug was reported in markdown-it:
markdown-it/markdown-it#583
Similar thing exists here, just for more complex pattern.
This takes 1 second (as well as multiple other similar combinations):
But this one takes 45 seconds (progressively worse with more data):
Expected result is
<em>_</em> _ <em>_</em> _ <em>_</em> _ <em>_</em> _ <em>_</em>
, and I suspect the issue is with_
character in between emphases trying to be paired with every single previous one.I don't know at the moment how or whether it can be fixed.
The text was updated successfully, but these errors were encountered: