hi -

quick question:

i want to take a chunk of text and convert anything that's a link to something clickable in the browser. (this is being used in 'request tracker', if anyone's interested.)

there's already a chunk of code that does this:

sub print_html{
my ($value) = shift;
my %map = ('<' => '&lt;', '>' => '&gt;', '&' => '&amp;');
$value =~ s/([<>\&])/$map{$1}/ge;
$value =~ s!(?:^|\b)
((?:https?|ftp|mailto)://[^\s\"\'/]+/[^\s():\"\']+)
!<A HREF=\"$1\">$1</A>!gx;
print $value;
}

so, this will take vanilla text (e-mail, mainly) and convert anything that begins with http:// or so forth into a clickable link. it works well.

the only problem is that people often e-mail us with links to images, which include spaces in the filename. "http://test.org/this is a test.jpg" for example.

the above code stops at the first space.

is there any easy way to modify this to account for spaces? if it makes it any easier, the links are always on a single line, i.e. they all end with a newline.

any help appreciated. sure it's just a matter of changing a few characters..

thanks.
[EMAIL PROTECTED]

_________________________________________________________________
Add photos to your messages with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to