Re:Genetic Algorithm building a little car
by ivankirigin on Monday December 08, 2008 @02:11PM
(#390196)
note to pg, these are valid URL characters: "()"
I'm surprised you of all people aren't more partial to them
The problem is breaking stuff like
(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.
Re:Genetic Algorithm building a little car
by ivankirigin on Monday December 08, 2008 @02:56PM
(#390297)
Indeed. Though I'm accustomed to adding a space at the end of urls.
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:
Re:Genetic Algorithm building a little car
by ivankirigin on Monday December 08, 2008 @08:08PM
(#390723)
The 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.
Yup, 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).
http://news.ycombinator.com/item?id=10889
When is a paren not a paren? When it's punctuation.
http://en.wikipedia.org/wiki/Chrysler_Group http://en.wikipedia.org/wiki/Daimler_AG http://en.wikipedia.org/wiki/Smart_(automobile)
I'll take this opportunity to note that bailing out companies originally founded by Americans in such a globalized market is arbitrary and harmful.