--- trunk/back2html.pm 2003/07/08 08:24:13 80 +++ branches/ffzg/back2html.pm 2005/01/18 17:17:06 637 @@ -6,6 +6,7 @@ sub back2html { my $html = shift; + my $url_params = shift; $html =~ s/</g; $html =~ s/>/>/g; @@ -16,16 +17,30 @@ # convert spaces in left field to non-breaking spaces $items[0] =~ s#\s+# #g; # try to make link on right field - if ($items[1] =~ m#(http://[\S]+)\s*.*?#i) { + sub mkurl($) { + my $url = shift || die "mkurl needs url as argument"; # chop URLS longer than 60 characters - my $url = substr($1,0,60); - $url .= "..." if (length($1) > 60); - $items[1] =~ s#(.*)\b(http://[\S]+)(\b?.*)#$1$url$3#g; + my $txturl = substr($1,0,60); + $txturl .= "..." if (length($1) > 60); + return "$txturl"; } + $items[1] =~ s#(http://[\S]+)#mkurl($1)#gie; $out .= join("