evilstreak / markdown-js

A Markdown parser for javascript
7.7k stars 863 forks source link

FIX: Support for IMG URLs with parentheses in them. #131

Closed eviltrout closed 11 years ago

eviltrout commented 11 years ago

Currently markdown-js doesn't support image URLs with parentheses in them. Having parentheses in URLs is valid and some sites like Wikipedia use them often.

This fix will first attempt to use a strong regexp to match URLs more accurately including parentheses. If it fails, it will revert to the old regex which is more permissive.

There's a new test for a funky URL which now passes (and all previous tests pass too.)

evilstreak commented 11 years ago

That regex is terrifying, and I usually like regexes.

Thanks for this.