Parentheses and auto-linked URLs

Message Bookmarked
Bookmark Removed
Parenthetical URLs confuse the autolinker, thus:

Hi there (see http://news.bbc.co.uk)

Note closing parentheses added to URL.

caek, Tuesday, 3 April 2007 00:29 (eighteen years ago)

good qa, caek!

chaki, Tuesday, 3 April 2007 00:34 (eighteen years ago)

just put a space between the url and the parantheses. it makes it easier to copy/paste as well.

lfam, Tuesday, 3 April 2007 01:17 (eighteen years ago)

Sure you can do that as a workaround, but the parser should handle this. This is a bug.

caek, Wednesday, 4 April 2007 02:46 (eighteen years ago)

http://news.bbc.co.uk

caek, Wednesday, 4 April 2007 14:29 (eighteen years ago)

There's another problem. That URL is linked with a trailing slash: <a href="http://news.bbc.co.uk/">. I didn't type one.

In the case of BBC news, these happen to be the same resources, but that's not generally true. The link-seeking code should not insert a trailing slash if there isn't one in the URL given.

caek, Wednesday, 4 April 2007 14:30 (eighteen years ago)

hm, good point

lfam, Wednesday, 4 April 2007 15:00 (eighteen years ago)

are parentheses allowed in urls? if yes, that would make parsing really hard.

lfam, Wednesday, 4 April 2007 15:01 (eighteen years ago)

[Removed Illegal Link]

Catsupppppppppppppp dude ‫茄蕃‪, Wednesday, 4 April 2007 15:46 (eighteen years ago)

ok, you can't put single quotes ' in urls, which you should be able to

Catsupppppppppppppp dude ‫茄蕃‪, Wednesday, 4 April 2007 15:47 (eighteen years ago)

[Removed Illegal Link]

and what, Wednesday, 4 April 2007 21:14 (eighteen years ago)

are parentheses allowed in urls? if yes, that would make parsing really hard.

Yes, e.g. http://en.wikipedia.org/wiki/Sheffield_%28disambiguation%29.

But pre-ILX2, this worked, and it's a solved problem on countless websites all over the web. It's a difficult one, for use, but there must be pre-rolled solutions. Having said that, this is perhaps not a high priority. I just wanted to get it on the record.

caek, Wednesday, 4 April 2007 21:43 (eighteen years ago)

Sorry. Parentheses got escaped out there. Here's a working URL with parentheses:

http://en.wikipedia.org/wiki/Omit_(band)

caek, Wednesday, 4 April 2007 21:45 (eighteen years ago)

(http://en.wikipedia.org/wiki/Omit_(band))

lfam, Thursday, 5 April 2007 18:41 (eighteen years ago)

I have looked at this and have made some changes that are here.

As lfam says, the example above is extremely tricky, and I would say that in the general case at least, there is not enough information to correctly isolate what is and isn't part of a URL. There's more of an explanation on the link above.

If you'd like to test it out on the test site, I would appreciate this.

Keith, Friday, 6 April 2007 14:33 (eighteen years ago)

Cheers Keith. Done some testing. Looks like that's fixed the (http://news.bbc.co.uk/) problem, and it's probably not worth the effort to spend more time on the parentheses within URLs problem. There's still a problem with trailing slashes being appended, e.g. if I type http://news.bbc.co.uk it is autolinked to http://news.bbc.co.uk/, which is wrong.

caek, Monday, 9 April 2007 13:32 (eighteen years ago)

That's a browser thing. View source on this: http://news.bbc.co.uk

stet, Monday, 9 April 2007 14:34 (eighteen years ago)

"http://news.bbc.co.uk"

you suck!

Catsupppppppppppppp dude ‫茄蕃‪, Wednesday, 11 April 2007 17:07 (eighteen years ago)

I said to him, "what's your website address?"
He said, "http://news.bbc.co.uk/"

Hey, you're right! URLs in quotes will get lots of use.

stet, Wednesday, 11 April 2007 18:43 (eighteen years ago)

Maybe you ought to do things right for once??

http://news.bbc.co.uk/~g/

Catsupppppppppppppp dude ‫茄蕃‪, Wednesday, 11 April 2007 20:29 (eighteen years ago)

[Removed Illegal Link]

Catsupppppppppppppp dude ‫茄蕃‪, Wednesday, 11 April 2007 20:29 (eighteen years ago)

That's a browser thing. View source on this:

Right you are. Thanks.

caek, Thursday, 12 April 2007 12:22 (eighteen years ago)

Oh dear. That showed up another bug. There was a [/i\ directly after that URL, which seems to have confused the URL parser.

caek, Thursday, 12 April 2007 12:24 (eighteen years ago)

Um, yeah. HTML entities still a problem. Is there any way to type a literal bracket in the meantime?

caek, Thursday, 12 April 2007 12:25 (eighteen years ago)

[ ]


the <code> tag??

jessie monster, Thursday, 12 April 2007 13:54 (eighteen years ago)

lol italics is everywhere.

jessie monster, Thursday, 12 April 2007 13:55 (eighteen years ago)


This thread has been locked by an administrator

You must be logged in to post. Please either login here, or if you are not registered, you may register here.