bloudraak / markdownsharp

Automatically exported from code.google.com/p/markdownsharp
0 stars 0 forks source link

URL detection bug for URLs that contain parentheses #55

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
SO's markdown can't make functional links for URLs that contain parentheses.

Example: dbpedia has a page for the D programming language: 
http://dbpedia.org/page/D_(programming_language).

When this URL is pasted into a SO message, SO fails to include the close 
parenthesis as part of the URL, resulting in a failing link:

http://dbpedia.org/page/D_(programming_language

If the SO poster uses the WYSIWYG hyperlink button, SO makes a different URL, 
but it also fails to function:

http://dbpedia.org/page/D_%28programming_language%29

Not all websites can decode encoded URLs; dbpedia happens to be one of them.

If the SO poster clicks the WYSIWYG button one more time and pastes the raw URL 
in again, the resulting link is finally functional:

http://dbpedia.org/page/D_(programming_language)

I suggest that markdownsharp examine its URL regex and consider supporting at 
least balanced parentheses, if not unbalanced parentheses, in URL matches.

Original issue reported on code.google.com by andrew.p...@gmail.com on 19 Oct 2012 at 5:09