This project is archived and is in readonly mode.

#2504 ✓resolved
cainlevy

auto_link should ignore multiple trailing punctuation marks

Reported by cainlevy | April 16th, 2009 @ 12:52 AM | in 2.x

auto_link currently only ignores one trailing punctuation mark. This patch adds a test and support for an arbitrary number of trailing punctuations.

Previously


auto_link("Lorum ipsum sit dolor amet (http://example.com).")
=> "Lorum ipsum sit dolor amet (<a href=\"http://example.com)\">http://example.com)</a>."

With Patch


auto_link("Lorum ipsum sit dolor amet (http://example.com).")
=> "Lorum ipsum sit dolor amet (<a href=\"http://example.com\">http://example.com</a>)."

Note: I wrote this patch against the 2-3-stable branch.

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

Referenced by

Pages