80 |
if ($input->{media_type} eq 'text/html') { |
if ($input->{media_type} eq 'text/html') { |
81 |
require Encode; |
require Encode; |
82 |
require Whatpm::HTML; |
require Whatpm::HTML; |
83 |
|
|
84 |
|
$input->{charset} ||= 'ISO-8859-1'; ## TODO: for now. |
85 |
|
|
86 |
my $t = Encode::decode ($input->{charset}, $input->{s}); |
my $t = Encode::decode ($input->{charset}, $input->{s}); |
87 |
|
|
89 |
<div id="parse-errors" class="section"> |
<div id="parse-errors" class="section"> |
90 |
<h2>Parse Errors</h2> |
<h2>Parse Errors</h2> |
91 |
|
|
92 |
<dl> |
<dl>]; |
|
]; |
|
93 |
push @nav, ['#parse-errors' => 'Parse Error']; |
push @nav, ['#parse-errors' => 'Parse Error']; |
94 |
|
|
95 |
my $onerror = sub { |
my $onerror = sub { |
116 |
Whatpm::HTML->parse_string ($t => $doc, $onerror); |
Whatpm::HTML->parse_string ($t => $doc, $onerror); |
117 |
} |
} |
118 |
|
|
119 |
print STDOUT qq[ |
print STDOUT qq[</dl> |
|
</dl> |
|
120 |
</div> |
</div> |
121 |
]; |
]; |
122 |
|
|
493 |
{ |
{ |
494 |
if (defined $Msg->{$type}) { |
if (defined $Msg->{$type}) { |
495 |
my $msg = $Msg->{$type}->[1]; |
my $msg = $Msg->{$type}->[1]; |
496 |
$msg =~ s/\$([0-9]+)/defined $arg[$1] ? htescape ($arg[$1]) : '(undef)'/ge; |
$msg =~ s{<var>\$([0-9]+)</var>}{ |
497 |
|
defined $arg[$1] ? htescape ($arg[$1]) : '(undef)'; |
498 |
|
}ge; |
499 |
return ($Msg->{$type}->[0], $msg); |
return ($Msg->{$type}->[0], $msg); |
500 |
} elsif ($type =~ s/:([^:]*)$//) { |
} elsif ($type =~ s/:([^:]*)$//) { |
501 |
unshift @arg, $1; |
unshift @arg, $1; |