-
Notifications
You must be signed in to change notification settings - Fork 36
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
Footnotes with strong-emphasis take forever to highlight #6
Comments
Does the same issue occur with the peg-markdown compiler?
Footnotes |
Just tested the HEAD version of peg-markdown. The text I posted above is processed instantly, but the result is not what I expected. To get footnotes to render correctly I need to put each of them in a separate paragraph (i.e. add an empty line between them). If I use the same corrected input with peg-markdown-highlight the highlighting is also instant. But I would at least expect it not to slow down so much even if the input is not well-formatted. |
I was not able to reproduce this, either via the command-line test program (
|
I suggest using Time Profiler in Instruments to check where the CPU time is used. |
Hmm, that slows down pretty quickly on mine (Mavericks, MacBook Air 1.7 GHz i7). The above took 0.1s, and if I add a couple more (7 in total) it takes more than 3 seconds. Doing a time profiling reveals no particular function causing significant amount of processing, but rather a ton of repeated calls of I tried a simpler input: Here are traces of the first and second examples. Hope they are useful.
|
I took some time to look into this and was able to fix this issue by updating the grammar to match the current state of
Thanks for the excellent bug report. Hopefully “better late than never” applies here. |
Thank you!! This is still a huge problem in MacDown, and based on the download count, the fix will help probably hundreds of users. 😄 |
The following literally takes seconds of near-100% CPU to highlight in the Cocoa demo:
And it gets worse with every
***
blocks you have. I observed some curious behaviours:***
markups matter. If you change any of the above***
s into**
, for example, the highlighting feels instant.A
in the first footnote, things will be fine.***
blocks there are after theA
. Say if you put theA
before***C***
things will improve a bit. But if you then add another footnote like[^6]: ***G***
things will go bad again.The text was updated successfully, but these errors were encountered: