21 |
my $input = $self->input; |
my $input = $self->input; |
22 |
my $result = $self->result; |
my $result = $self->result; |
23 |
|
|
|
my $onerror = sub { |
|
|
my (%opt) = @_; |
|
|
my ($type, $cls, $msg) = get_text ($opt{type}, $opt{level}); |
|
|
$out->html (qq[<dt class="$cls">], get_error_label ($input, \%opt)); |
|
|
$type =~ tr/ /-/; |
|
|
$type =~ s/\|/%7C/g; |
|
|
$msg .= qq[ [<a href="../error-description#@{[htescape ($type)]}">Description</a>]]; |
|
|
$out->html (qq[<dd class="$cls">], get_error_level_label (\%opt) . $msg); |
|
|
|
|
|
add_error ('syntax', \%opt => $result); |
|
|
}; |
|
|
|
|
24 |
my $m = $input->{is_char_string} ? 'parse_char_string' : 'parse_byte_string'; |
my $m = $input->{is_char_string} ? 'parse_char_string' : 'parse_byte_string'; |
25 |
$self->{structure} = Whatpm::CacheManifest->$m |
$self->{structure} = Whatpm::CacheManifest->$m |
26 |
($input->{s}, $input->{uri}, $input->{base_uri}, $onerror); |
($input->{s}, $input->{uri}, $input->{base_uri}, sub { |
27 |
|
$result->add_error (@_, layer => 'syntax', index_has_link => 1); |
28 |
|
}); |
29 |
|
|
30 |
$out->end_tag ('dl'); |
$out->end_tag ('dl'); |
31 |
$out->end_section; |
$out->end_section; |
77 |
my $result = $out->result; |
my $result = $out->result; |
78 |
|
|
79 |
Whatpm::CacheManifest->check_manifest ($self->{structure}, sub { |
Whatpm::CacheManifest->check_manifest ($self->{structure}, sub { |
80 |
my %opt = @_; |
$result->add_error (@_, layer => 'structure'); |
|
my ($type, $cls, $msg) = get_text ($opt{type}, $opt{level}, $opt{node}); |
|
|
$type =~ tr/ /-/; |
|
|
$type =~ s/\|/%7C/g; |
|
|
$msg .= qq[ [<a href="../error-description#@{[htescape ($type)]}">Description</a>]]; |
|
|
$out->html (qq[<dt class="$cls">] . get_error_label ($input, \%opt) . |
|
|
qq[</dt>\n<dd class="$cls">], $msg, "</dd>\n"); |
|
|
add_error ('structure', \%opt => $result); |
|
81 |
}); |
}); |
82 |
|
|
83 |
$out->end_section; |
$out->end_section; |