InternalError: too much recursion
Hi, I wrote a table for the documentation of a component in storybook that uses an html list inside. And my chrome started to hang and firefox started to crash with the error that recursion is too deep. After an hour of debugging I realized that the problem is in your library. Made a sandbox with a minimal example. https://codesandbox.io/s/5yusm?file=/src/App.tsx In chrome it is very slow to work, in firefox it crashes with an error, so I suggest looking at the sandbox through firefox. Your library is cool, but it seems the algorithm is too slow when dealing with tables and content inside a table. Unfortunately I don't know how to do it better :(
JS shows the error in this place: https://github.com/probablyup/markdown-to-jsx/blob/main/index.tsx#L716 https://github.com/probablyup/markdown-to-jsx/blob/main/index.tsx#L655
Below is a video of how the browser reacts by removing a few extra spaces.
https://user-images.githubusercontent.com/11390039/123175287-371aa300-d48a-11eb-81de-3102051cfaa7.mov
I'm hitting this too, I'm pretty sure it's effectively an evil regexp causing a DoS https://owasp.org/www-community/attacks/Regular_expression_Denial_of_Service_-_ReDoS
but those regexps are beyond my expertise to debug:
https://github.com/probablyup/markdown-to-jsx/blob/ebd044aa1257751c2dec3f28d09ec8c54dff8c39/index.tsx#L298-L311
Is there a fix for this too much recursion error?