94 |
|
|
95 |
my $onerror = sub { |
my $onerror = sub { |
96 |
my (%opt) = @_; |
my (%opt) = @_; |
97 |
my ($cls, $msg) = get_text ($opt{type}, $opt{level}); |
my ($type, $cls, $msg) = get_text ($opt{type}, $opt{level}); |
98 |
if ($opt{column} > 0) { |
if ($opt{column} > 0) { |
99 |
print STDOUT qq[<dt class="$cls"><a href="#line-$opt{line}">Line $opt{line}</a> column $opt{column}</dt>\n]; |
print STDOUT qq[<dt class="$cls"><a href="#line-$opt{line}">Line $opt{line}</a> column $opt{column}</dt>\n]; |
100 |
} else { |
} else { |
101 |
$opt{line} = $opt{line} - 1 || 1; |
$opt{line} = $opt{line} - 1 || 1; |
102 |
print STDOUT qq[<dt class="$cls"><a href="#line-$opt{line}">Line $opt{line}</a></dt>\n]; |
print STDOUT qq[<dt class="$cls"><a href="#line-$opt{line}">Line $opt{line}</a></dt>\n]; |
103 |
} |
} |
104 |
$opt{type} =~ tr/ /-/; |
$type =~ tr/ /-/; |
105 |
$opt{type} =~ s/\|/%7C/g; |
$type =~ s/\|/%7C/g; |
106 |
$msg .= qq[ [<a href="../error-description#$opt{type}">Description</a>]]; |
$msg .= qq[ [<a href="../error-description#@{[htescape ($type)]}">Description</a>]]; |
107 |
print STDOUT qq[<dd class="$cls">$msg</dd>\n]; |
print STDOUT qq[<dd class="$cls">$msg</dd>\n]; |
108 |
}; |
}; |
109 |
|
|
185 |
require Whatpm::ContentChecker; |
require Whatpm::ContentChecker; |
186 |
my $onerror = sub { |
my $onerror = sub { |
187 |
my %opt = @_; |
my %opt = @_; |
188 |
my ($cls, $msg) = get_text ($opt{type}, $opt{level}); |
my ($type, $cls, $msg) = get_text ($opt{type}, $opt{level}); |
189 |
$opt{type} = $opt{level} . ':' . $opt{type} if defined $opt{level}; |
$type =~ tr/ /-/; |
190 |
$opt{type} =~ tr/ /-/; |
$type =~ s/\|/%7C/g; |
191 |
$opt{type} =~ s/\|/%7C/g; |
$msg .= qq[ [<a href="../error-description#@{[htescape ($type)]}">Description</a>]]; |
|
$msg .= qq[ [<a href="../error-description#$opt{type}">Description</a>]]; |
|
192 |
print STDOUT qq[<dt class="$cls">] . get_node_link ($opt{node}) . |
print STDOUT qq[<dt class="$cls">] . get_node_link ($opt{node}) . |
193 |
qq[</dt>\n<dd class="$cls">], $msg, "</dd>\n"; |
qq[</dt>\n<dd class="$cls">], $msg, "</dd>\n"; |
194 |
}; |
}; |
245 |
for (@$_) { |
for (@$_) { |
246 |
$_->{id} = refaddr $_->{element} if defined $_->{element}; |
$_->{id} = refaddr $_->{element} if defined $_->{element}; |
247 |
delete $_->{element}; |
delete $_->{element}; |
248 |
|
$_->{is_header} = $_->{is_header} ? 1 : 0; |
249 |
} |
} |
250 |
} |
} |
251 |
} |
} |
496 |
$msg =~ s{<var>\$([0-9]+)</var>}{ |
$msg =~ s{<var>\$([0-9]+)</var>}{ |
497 |
defined $arg[$1] ? htescape ($arg[$1]) : '(undef)'; |
defined $arg[$1] ? htescape ($arg[$1]) : '(undef)'; |
498 |
}ge; |
}ge; |
499 |
return ($Msg->{$type}->[0], $msg); |
return ($type, $Msg->{$type}->[0], $msg); |
500 |
} elsif ($type =~ s/:([^:]*)$//) { |
} elsif ($type =~ s/:([^:]*)$//) { |
501 |
unshift @arg, $1; |
unshift @arg, $1; |
502 |
redo; |
redo; |
503 |
} |
} |
504 |
} |
} |
505 |
return ('', htescape ($_[0])); |
return ($type, '', htescape ($_[0])); |
506 |
} # get_text |
} # get_text |
507 |
|
|
508 |
} |
} |