Allow balanced round braces in URLs
parent
08c91c0007
commit
64341d027c
|
@ -289,15 +289,12 @@ sub quoteUrls
|
||||||
~gesix;
|
~gesix;
|
||||||
}
|
}
|
||||||
|
|
||||||
$text =~ s~
|
# the protocol + non-whitespace + recursive braces + ending in [\w/~=)]
|
||||||
\b((?:$safe_protocols): # The protocol:
|
$text =~ s/\b((?:$safe_protocols):([^\s<>\"\(\)]+|\((?2)*\))+(?<=[\w\/~=)]))/
|
||||||
[^\s<>\"]+ # Any non-whitespace
|
|
||||||
[\w\/]) # so that we end in \w or /
|
|
||||||
~
|
|
||||||
($tmp = html_quote($1)) &&
|
($tmp = html_quote($1)) &&
|
||||||
($things[$count++] = "<a href=\"$tmp\">$tmp</a>") &&
|
($things[$count++] = "<a href=\"$tmp\">$tmp<\/a>") &&
|
||||||
("\0\0" . ($count-1) . "\0\0")
|
("\0\0" . ($count-1) . "\0\0")
|
||||||
~gesox;
|
/gesox;
|
||||||
|
|
||||||
if ($custom_proto && %$custom_proto)
|
if ($custom_proto && %$custom_proto)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue