Include trailing ) in make_clickable if it is part of the URL
|Reported by:||josephscott||Owned by:||westi|
Parentheses are valid characters in URLs, for instance:
But it also common to include a URL reference inside of parentheses that aren't part of a URL, like:
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.
Change History (19)
comment:11 westi — 4 years ago
- Owner changed from azaozz to westi
- Status changed from new to accepted