/[suikacvs]/markup/html/whatpm/t/HTML-tokenizer.t
Suika

Diff of /markup/html/whatpm/t/HTML-tokenizer.t

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

revision 1.35 by wakaba, Sun Apr 13 10:36:41 2008 UTC revision 1.40 by wakaba, Sun Sep 14 03:07:58 2008 UTC
# Line 26  BEGIN { Line 26  BEGIN {
26  }  }
27    
28  use Test;  use Test;
29  BEGIN { plan tests => 1068 }  BEGIN { plan tests => 1073 }
30    
31  use Data::Dumper;  use Data::Dumper;
32  $Data::Dumper::Useqq = 1;  $Data::Dumper::Useqq = 1;
33    $Data::Dumper::Sortkeys = 1;
34  sub Data::Dumper::qquote {  sub Data::Dumper::qquote {
35    my $s = shift;    my $s = shift;
36    $s =~ s/([^\x20\x21-\x26\x28-\x5B\x5D-\x7E])/sprintf '\x{%02X}', ord $1/ge;    $s =~ s/([^\x20\x21-\x26\x28-\x5B\x5D-\x7E])/sprintf '\x{%02X}', ord $1/ge;
# Line 149  for my $file_name (grep {$_} split /\s+/ Line 150  for my $file_name (grep {$_} split /\s+/
150        };        };
151        $p->{prev_char} = [-1, -1, -1];        $p->{prev_char} = [-1, -1, -1];
152        $p->{next_char} = -1;        $p->{next_char} = -1;
153    
154          $p->{read_until} = sub { return 0 };
155                
156        $p->{parse_error} = sub {        $p->{parse_error} = sub {
157          push @token, 'ParseError';          push @token, 'ParseError';
# Line 180  for my $file_name (grep {$_} split /\s+/ Line 183  for my $file_name (grep {$_} split /\s+/
183          $test_token->[1] = $token->{data} if defined $token->{data};          $test_token->[1] = $token->{data} if defined $token->{data};
184          if ($token->{type} == Whatpm::HTML::START_TAG_TOKEN ()) {          if ($token->{type} == Whatpm::HTML::START_TAG_TOKEN ()) {
185            $test_token->[2] = {map {$_->{name} => $_->{value}} values %{$token->{attributes}}};            $test_token->[2] = {map {$_->{name} => $_->{value}} values %{$token->{attributes}}};
186            if ({            $test_token->[3] = 1 if $p->{self_closing};
187                 ## NOTE: Permitted slash            delete $p->{self_closing};
                br => 1, link => 1,  
               }->{$token->{tag_name}}) {  
             delete $p->{self_closing};  
           }  
188          } elsif ($token->{type} == Whatpm::HTML::DOCTYPE_TOKEN ()) {          } elsif ($token->{type} == Whatpm::HTML::DOCTYPE_TOKEN ()) {
189            $test_token->[1] = $token->{name};            $test_token->[1] = $token->{name};
190            $test_token->[2] = $token->{public_identifier};            $test_token->[2] = $token->{public_identifier};

Legend:
Removed from v.1.35  
changed lines
  Added in v.1.40

[email protected]
ViewVC Help
Powered by ViewVC 1.1.24