coreyti/showdown — pull request #32 by unwiredben (2012-09-08 19:22:21+00:00)
Title: Fix excessive runtime by optimizing regex

Remove unnecessary "match anything" test that caused excessive run times on some mixed content
Update HTML5 structural tags test to also verify correctness this regexp and the previous one.

I reran mocha tests after this change with no failures. I needed this because I'm running this as part of a macro in Google Documents, and the old code was triggering an "excessive run time" error due to the regexp taking too long. Removing this .* seemed to fix the problem, and I couldn't understand why it would be needed with the preceding match all but CR test. The \r based tests are very odd, as earlier in the code, there's replace operations that remove any \r's from the text, but I'll take it at face value that they're needed to workaround a PCRE bug.