8 |
my $html = shift; |
my $html = shift; |
9 |
|
|
10 |
my $out; |
my $out; |
11 |
foreach $line (split(/###/,$html)) { |
foreach $line (split(/\s*###\s*/,$html)) { |
12 |
$out .= "<tr><td>"; |
$out .= "<tr><td valign=\"top\">"; |
13 |
my @items = split(/#-#/,$line); |
my @items = split(/\s*#-#\s*/,$line); |
14 |
|
# convert spaces in left field to non-breaking spaces |
15 |
|
$items[0] =~ s#\s+# #g; |
16 |
|
# try to make link on right field |
17 |
|
if ($items[1] =~ m#(http://[\S]+)\s*.*?#i) { |
18 |
|
# chop URLS longer than 60 characters |
19 |
|
my $url = substr($1,0,60); |
20 |
|
$url .= "..." if (length($1) > 60); |
21 |
|
$items[1] =~ s#(.*)\b(http://[\S]+)(\b?.*)#$1<a href=\"$2\">$url</a>$3#g; |
22 |
|
} |
23 |
$out .= join("</td><td>",@items); |
$out .= join("</td><td>",@items); |
24 |
$out .= "</td></tr>\n"; |
$out .= "</td></tr>\n"; |
25 |
} |
} |
26 |
|
$out =~ s/<br\/*>/<br\/>/g; |
27 |
return $out; |
return $out; |
28 |
} |
} |
29 |
|
|