3 ms·
It's possible to get around using escape sequences. In Python: import urllib print urllib.quote("en.wikipedia.org/wiki/Smart_(automobile)") It looks ugly
by bd 18y ago
It's possible to get around using escape sequences.
In Python:
import urllib
print urllib.quote("en.wikipedia.org/wiki/Smart_(automobile)")
It looks ugly, but it makes links clickable:
http://en.wikipedia.org/wiki/Smart_%28automobile%29 http://en.wikipedia.org/wiki/Smart_%28automobile%29
- ivankirigin 18y agoThe href can be that ugly link while the parens are still visible. The issue is when to parse the parens as part of the link. Edit: but I guess you're saying I could do this to make it clickable. No thanks.
- bd 18y agoYup, that's what I ment. This is what I do when posting Wikipedia urls with parens here. 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).