1 |
dpavlin |
13 |
# |
2 |
|
|
# reformat html inside xml back to html (basically, support for tables) |
3 |
|
|
# |
4 |
|
|
# filed #-# field ### |
5 |
|
|
# ... |
6 |
|
|
|
7 |
|
|
sub back2html { |
8 |
|
|
my $html = shift; |
9 |
|
|
|
10 |
|
|
my $out; |
11 |
|
|
foreach $line (split(/###/,$html)) { |
12 |
|
|
$out .= "<tr><td>"; |
13 |
|
|
my @items = split(/#-#/,$line); |
14 |
dpavlin |
65 |
$items[1] =~ s#(.*)\b(http://[\w\./]+)(\b?.*)#$1<a href=\"$2\">$2</a>$3#g; |
15 |
dpavlin |
13 |
$out .= join("</td><td>",@items); |
16 |
|
|
$out .= "</td></tr>\n"; |
17 |
|
|
} |
18 |
dpavlin |
31 |
$out =~ s/<br\/*>/<br\/>/g; |
19 |
dpavlin |
13 |
return $out; |
20 |
|
|
} |
21 |
|
|
|
22 |
|
|
1; |