--- trunk/back2html.pm 2003/07/04 20:41:17 64
+++ trunk/back2html.pm 2003/07/04 23:28:17 66
@@ -11,8 +11,12 @@
foreach $line (split(/###/,$html)) {
$out .= "
";
my @items = split(/#-#/,$line);
- if ($items[1] =~ m#^http://#) {
- $items[1] = "$items[1]";
+ if ($items[1] =~ m#(http://[\S]+)\s*.*?#i) {
+ my $url = $1;
+ # 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;
}
$out .= join(" | ",@items);
$out .= " |
\n";