This project is archived and is in readonly mode.

#234 ✓resolved
Adam Traver

Make auto_link accept parentheses in URLs

Reported by Adam Traver | May 21st, 2008 @ 09:25 PM

Currently, the regular expression used in auto_link_urls and, by association, auto_link, does not allow for parentheses in URLs.

While this is not a very common occurrence (nor proper, I don't believe, but I could be wrong), there are certain highly populated sites that use this format. Take Wikipedia, for instance:

http://en.wikipedia.org/wiki/Spr...(computer_graphics)

With the current implementation of auto_link, the link you get back looks like this:

<a href="http://en.wikipedia.org/wiki/Sprite_">http://en.wikipedia.org/wiki/Spr...</a>(computer_graphics)

This patch adds both opening and closing parentheses to the list of allowable characters for the path in the AUTO_LINK_RE regular expression.

P.S. This is my first submission, so if I've done anything wrong in the patch/ticket creation process, please don't freak out. :-p

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

People watching this ticket

Attachments

Pages