--- test/html-webhacc/WebHACC/Result.pm 2008/08/15 16:03:46 1.13 +++ test/html-webhacc/WebHACC/Result.pm 2008/12/11 03:22:57 1.21 @@ -117,6 +117,8 @@ $column = $opt{column}; } } + $line += $opt{line_diff} || 0 if defined $line; + $column += $opt{column_diff} || 0 if defined $column; $line = $line - 1 || 1 if defined $line and not (defined $column and $column > 0); @@ -168,9 +170,43 @@ $has_location = 1; } - if (defined $opt{value}) { + if (not defined $opt{valueref} and defined $opt{value}) { + $opt{valueref} = \($opt{value}); + } + + if (defined $opt{valueref}) { $out->html (' '); - $out->code ($opt{value}); + if (defined $opt{pos_start}) { + $out->start_tag ('code'); + $out->text (substr ${$opt{valueref}}, 0, $opt{pos_start}); + $out->start_tag ('mark'); + $out->text (substr ${$opt{valueref}}, $opt{pos_start}, + $opt{pos_end} - $opt{pos_start}); + $out->end_tag ('mark'); + $out->text (substr ${$opt{valueref}}, $opt{pos_end}) + if $opt{pos_end} < length ${$opt{valueref}}; + $out->end_tag ('code'); + } elsif ($opt{value_mark_end}) { + $out->start_tag ('code'); + $out->text (${$opt{valueref}}); + $out->start_tag ('mark'); + $out->end_tag ('mark'); + $out->end_tag ('code'); + } elsif (defined $opt{value_mark}) { + $out->start_tag ('code'); + for (split /($opt{value_mark})/, ${$opt{valueref}}) { + if (/$opt{value_mark}/) { + $out->start_tag ('mark'); + $out->text ($_); + $out->end_tag ('mark'); + } else { + $out->text ($_); + } + } + $out->end_tag ('code'); + } else { + $out->code (${$opt{valueref}}); + } $has_location = 1; } @@ -185,8 +221,8 @@ } elsif (defined $opt{input}->{request_uri}) { $out->url ($opt{input}->{request_uri}); $has_location = 1; - } elsif (defined $opt{input}->{uri}) { - $out->url ($opt{input}->{uri}); + } elsif (defined $opt{input}->url) { + $out->url ($opt{input}->url); $has_location = 1; } } @@ -205,14 +241,8 @@ ## Error message my $error_type_text = $opt{type}; $out->nl_text ($error_type_text, node => $opt{node}, text => $opt{text}, - value => $opt{value}); - - ## Additional error description - if (defined $opt{text}) { ## TODO: Remove this block once all errors are put into the catalog. - $out->html (' ('); - $out->text ($opt{text}); - $out->html (')'); - } + value => ${$opt{valueref} or \''}, char => $opt{char}, + octets => $opt{octets}); ## Link to a long description @@ -220,8 +250,10 @@ $fragment =~ tr/ /-/; $fragment = $out->encode_url_component ($fragment); $out->text (' ['); - $out->link ('Description', url => '../error-description#' . $fragment, - rel => 'help'); + $out->start_tag ('a', href => '../error-description#' . $fragment, + rel => 'help'); + $out->nl_text ('Description'); + $out->end_tag ('a'); $out->text (']'); if ($error_level eq 'm') { @@ -295,8 +327,9 @@ target => 'parse-errors', score_base => 10, parent_status => $maindoc_status}, {label => 'Char L.', status => $self->{layers}->{charset}, - score_base => 10, + target => 'parse-errors', score_base => 10, parent_status => $maindoc_status}, + ## TODO: char semantics layer {label => 'Syntax L.', status => $self->{layers}->{syntax}, target => 'parse-errors', score_base => 20, parent_status => $maindoc_status},