fletcher / MultiMarkdown-5

Reference implementation of MultiMarkdown; replaces MultiMarkdown v4 (deprecated -- see MMD-6 instead)
https://github.com/fletcher/MultiMarkdown-6
Other
294 stars 46 forks source link

MMD 5.1 and 5.2 hang when parsing nested stong and emphasis #18

Closed antons closed 8 years ago

antons commented 8 years ago

First of all, thank you for you work on MultiMarkdown.

While testing MMD 5.1 and 5.2, we’ve discovered a serious performance regression from 5.0.1. It can be easily reproduced by parsing documents where the following example line is repeated more than once.

**b**, _u_, __v__, *__w__*, _**x**_, ***y***, ___z___, *t __w__ t*
fletcher commented 8 years ago

Yeah -- I alluded to this elsewhere when commenting about the 5.2 release and changes to strong/emph parsing. I didn't have a good example that "broke" things though. Just a general mild slowdown.

Using your example, I was able to experiment a bit and found a way to fix the problem. Parsing 70 lines of your example is essentially "instantaneous".

Fix pushed to develop branch.

Thanks!!

antons commented 8 years ago

Glad the test case was useful. Thank you!