markdown-to-jsx
markdown-to-jsx copied to clipboard
Resolve issue with catastrophic backtracking regex
Catastrophic backtracking in the BREAK_THEMATIC_R regex causes parsing to hang on non-matching input with repeating asterisks like this:
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
SOME TEXT
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
or even just:
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
This minor regex change resolves that issue without changing the matched pattern or capture group.