/[suikacvs]/markup/html/whatpm/Whatpm/HTML/Serializer.pm
Suika

Diff of /markup/html/whatpm/Whatpm/HTML/Serializer.pm

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

revision 1.1 by wakaba, Sun Nov 11 04:59:36 2007 UTC revision 1.4 by wakaba, Sat May 24 10:58:19 2008 UTC
# Line 52  sub get_inner_html ($$$) { Line 52  sub get_inner_html ($$$) {
52          $attr_value =~ s/</&lt;/g;          $attr_value =~ s/</&lt;/g;
53          $attr_value =~ s/>/&gt;/g;          $attr_value =~ s/>/&gt;/g;
54          $attr_value =~ s/"/&quot;/g;          $attr_value =~ s/"/&quot;/g;
55            $attr_value =~ s/\xA0/&nbsp;/g;
56          $s .= $attr_value . '"';          $s .= $attr_value . '"';
57        }        }
58        $s .= '>';        $s .= '>';
# Line 63  sub get_inner_html ($$$) { Line 64  sub get_inner_html ($$$) {
64          spacer => 1, wbr => 1,          spacer => 1, wbr => 1,
65        }->{$tag_name};        }->{$tag_name};
66    
67        $s .= "\x0A" if $tag_name eq 'pre' or $tag_name eq 'textarea';        $s .= "\x0A" if {pre => 1, textarea => 1, listing => 1}->{$tag_name};
68    
69        if (not $in_cdata and {        if (not $in_cdata and {
70          style => 1, script => 1, xmp => 1, iframe => 1,          style => 1, script => 1, xmp => 1, iframe => 1,
# Line 84  sub get_inner_html ($$$) { Line 85  sub get_inner_html ($$$) {
85          $value =~ s/</&lt;/g;          $value =~ s/</&lt;/g;
86          $value =~ s/>/&gt;/g;          $value =~ s/>/&gt;/g;
87          $value =~ s/"/&quot;/g;          $value =~ s/"/&quot;/g;
88            $value =~ s/\xA0/&nbsp;/g;
89          $s .= $value;          $s .= $value;
90        }        }
91      } elsif ($nt == 8) {      } elsif ($nt == 8) {
# Line 92  sub get_inner_html ($$$) { Line 94  sub get_inner_html ($$$) {
94        $s .= '<!DOCTYPE ' . $child->name . '>';        $s .= '<!DOCTYPE ' . $child->name . '>';
95      } elsif ($nt == 5) { # entrefs      } elsif ($nt == 5) { # entrefs
96        push @node, @{$child->child_nodes};        push @node, @{$child->child_nodes};
97        } elsif ($nt == 7) { # PIs
98          $s .= '<?' . $child->target . ' ' . $child->data . '>';
99      } else {      } else {
100        $on_error->($child) if defined $on_error;        $on_error->($child) if defined $on_error;
101      }      }
     ## ISSUE: This code does not support PIs.  
102    } # C    } # C
103        
104    ## Step 3    ## Step 3
# Line 104  sub get_inner_html ($$$) { Line 107  sub get_inner_html ($$$) {
107    
108  =head1 LICENSE  =head1 LICENSE
109    
110  Copyright 2007 Wakaba <w@suika.fam.cx>  Copyright 2007-2008 Wakaba <w@suika.fam.cx>
111    
112  This library is free software; you can redistribute it  This library is free software; you can redistribute it
113  and/or modify it under the same terms as Perl itself.  and/or modify it under the same terms as Perl itself.

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.4

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24