tanakahisateru/js-markdown-extra — pull request #29 by iphands (2013-05-10 19:52:38+00:00)
Title: Adding conditional wraps around two regexes in doAnchors, this should pr...

This patch wraps two regular replace()s in a safety check that should prevent the run away callback scenarios from occurring and not affect the replace().

Wrapping the regex in a safety check aslo keeps the regex code untouched, so it can be compared easliy with the "upstream" PHP impl.

To test before and after try:
```javascript

var start = new Date().getTime();
md.Markdown(str);
var elapsed = new Date().getTime() - start;
console.log("run #" + i + " took: " + elapsed + "ms");
```