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.

auto_link should ignore multiple trailing punctuation marks

#2504

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.

Reported by cainlevy · April 16th, 2009 @ 12:52 AM

State: resolved
Milestone: 2.x
Assigned to: nobody
Importance: none