URL's with spaces don't render correctly
eg
http://test/a%20test%20with%20spaces.html
this is just the tip of the iceberg... but it is the bit that i have fixed...
from
http://www.ietf.org/rfc/rfc2396.txt
you can see that there are actually more escape sequences possible
My Solution
sub externalLink
{
my( $pre, $url ) = @_;
my ( $renderedUrl ) = $url;
$renderedUrl =~ s/%20/ /g;
if( $url =~ /\.(gif|jpg|jpeg)$/ ) {
my $filename = $renderedUrl;
$filename =~ s@.*/([^/]*)@$1@go;
return "$pre<IMG src=\"$url\" alt=\"$filename\">";
}
return "$pre<A href=\"$url\" target=\"_top\">$renderedUrl</A>";
}
.......snip.....
# Handle embedded URLs
s@(^|[\-\*\s])((http|ftp|gopher|news|https|file)\:(\S+[^\s\.,!\?;:]))@&externalLink($1,$2)@geo;
--
SvenDowideit - 29 Dec 2000
First I wanted to put it into the core but then decided not to do that because users may want to print out the URL and copy the URL into the clipboard. If you change the escaped chars to literal chars you will lose that capability.
--
PeterThoeny - 26 Nov 2001
On the other hand the user could just click on the link and copy from the navigation input. I'ld prefer correctly rendered pages since anybody sees them while not anybody will want to copy them directly. Just my preference
--
MichaelUtech
I've decided to re-open this as I think I disagree with Peter..

in this specific case (spaces as % 20) there
should be no problem with the user cutting and pasting the rendered URL. I'm not sure about the other special characters, but I think that the browser takes care of them too.
--
SvenDowideit - 28 Nov 2002