/[suikacvs]/test/html-webhacc/WebHACC/Language/HTML.pm
Suika

Diff of /test/html-webhacc/WebHACC/Language/HTML.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.9 by wakaba, Sat Aug 16 07:42:20 2008 UTC revision 1.10 by wakaba, Thu Sep 11 09:13:57 2008 UTC
# Line 14  sub generate_syntax_error_section ($) { Line 14  sub generate_syntax_error_section ($) {
14    require Encode;    require Encode;
15    require Whatpm::HTML;    require Whatpm::HTML;
16        
   $self->result->layer_uncertain ('charset');  
   
17    my $out = $self->output;    my $out = $self->output;
18    $out->start_section (role => 'parse-errors');    $out->start_section (role => 'parse-errors');
19    $out->start_error_list (role => 'parse-errors');    $out->start_error_list (role => 'parse-errors');
# Line 38  sub generate_syntax_error_section ($) { Line 36  sub generate_syntax_error_section ($) {
36      }      }
37    };    };
38    
39      $self->result->layer_applicable ('charset');
40      my $char_checker = sub ($) {
41        require Whatpm::Charset::UnicodeChecker;
42        return Whatpm::Charset::UnicodeChecker->new_handle ($_[0]);
43      }; # $char_checker
44    
45    my $dom = Message::DOM::DOMImplementation->new;    my $dom = Message::DOM::DOMImplementation->new;
46    my $doc = $dom->create_document;    my $doc = $dom->create_document;
47    my $el;    my $el;
# Line 52  sub generate_syntax_error_section ($) { Line 56  sub generate_syntax_error_section ($) {
56            
57      $el = $doc->create_element_ns      $el = $doc->create_element_ns
58          ('http://www.w3.org/1999/xhtml', [undef, $inner_html_element]);          ('http://www.w3.org/1999/xhtml', [undef, $inner_html_element]);
59      Whatpm::HTML->set_inner_html ($el, $$t, $onerror);      Whatpm::HTML->set_inner_html ($el, $$t, $onerror, $char_checker);
60    
61      $self->{structure} = $el;      $self->{structure} = $el;
62      $self->{_structure_root} = $doc;      $self->{_structure_root} = $doc;
# Line 61  sub generate_syntax_error_section ($) { Line 65  sub generate_syntax_error_section ($) {
65          ## reference.          ## reference.
66    } else {    } else {
67      if ($input->{is_char_string}) {      if ($input->{is_char_string}) {
68        Whatpm::HTML->parse_char_string ($input->{s} => $doc, $onerror);        Whatpm::HTML->parse_char_string ($input->{s} => $doc,
69                                           $onerror, $char_checker);
70      } else {      } else {
71        $self->result->layer_applicable ('encode');        $self->result->layer_applicable ('encode');
72        Whatpm::HTML->parse_byte_string        Whatpm::HTML->parse_byte_string
73            ($input->{charset}, $input->{s} => $doc, $onerror);            ($input->{charset}, $input->{s} => $doc, $onerror, $char_checker);
74      }      }
75    
76      $self->{structure} = $doc;      $self->{structure} = $doc;

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24