Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Make auto_link accept parentheses in URLs

#234

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

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

State: resolved
Milestone: none
Assigned to: nobody
Importance: none

Activity

  1. Ryan Bates
    Ryan Bates

    +1, tested patch and looks good. Nice job on your first submission!

    May 21st, 2008 @ 11:51 PM

  2. Repository
    Repository
    • State changed from new to resolved

    (from [314e556e6fb7278e37f6105fedbe5fc51f7f848a]) Parentheses should be acceptable characters for auto_link_urls. [#234 state:resolved]

    Signed-off-by: Pratik Naik

    http://github.com/rails/rails/co...

    May 22nd, 2008 @ 11:33 AM