by ivankirigin · 17y ago · 0 comments
I'm surprised you of all people aren't more partial to them
(also see url: http://google.com)
Might be better to treat a trailing ) as not part of a url only if there is no ( earlier in the url.
In Python:
import urllib
print urllib.quote("en.wikipedia.org/wiki/Smart_(automobile)")
It looks ugly, but it makes links clickable:Edit: but I guess you're saying I could do this to make it clickable. No thanks.
For parsing parens problem, heuristics proposed by lacker seems reasonable.
Anyway, I guess like 99% of broken parens cases here would be Wikipedia links, which are quite well defined (except for pages for emoticons and parens symbols themselves).
When is a paren not a paren? When it's punctuation.