[wp-trac] [WordPress Trac] #10990: Include trailing ) in make_clickable if it is part of the URL
WordPress Trac
wp-trac at lists.automattic.com
Wed Oct 21 05:48:38 UTC 2009
#10990: Include trailing ) in make_clickable if it is part of the URL
--------------------------+-------------------------------------------------
Reporter: josephscott | Owner: azaozz
Type: defect (bug) | Status: new
Priority: normal | Milestone: 2.9
Component: Formatting | Version: 2.8.4
Severity: normal | Keywords: has-patch
--------------------------+-------------------------------------------------
Parentheses are valid characters in URLs, for instance:
{{{
http://en.wikipedia.org/wiki/PC_Tools_(Central_Point_Software)
}}}
But it also common to include a URL reference inside of parentheses that
aren't part of a URL, like:
{{{
(http://www.example.com/)
}}}
The make_clickable() function in -trunk works for the second case, but not
the first. The link it creates doesn't include in the trailing paren.
The pattern that seems to work is if the first and last characters (second
example) are parens then don't include the trailing paren in the URL. If
the first character isn't a paren (the first example) then include the
trailing paren in the URL.
I'm including a simple patch to make make_clickable() work correctly for
these URLs.
I think WP used to work this way, I suspect rev 11844 changed this
behavior.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/10990>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list