| 52 |
$attr_value =~ s/</</g; |
$attr_value =~ s/</</g; |
| 53 |
$attr_value =~ s/>/>/g; |
$attr_value =~ s/>/>/g; |
| 54 |
$attr_value =~ s/"/"/g; |
$attr_value =~ s/"/"/g; |
| 55 |
|
$attr_value =~ s/\xA0/ /g; |
| 56 |
$s .= $attr_value . '"'; |
$s .= $attr_value . '"'; |
| 57 |
} |
} |
| 58 |
$s .= '>'; |
$s .= '>'; |
| 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, |
| 85 |
$value =~ s/</</g; |
$value =~ s/</</g; |
| 86 |
$value =~ s/>/>/g; |
$value =~ s/>/>/g; |
| 87 |
$value =~ s/"/"/g; |
$value =~ s/"/"/g; |
| 88 |
|
$value =~ s/\xA0/ /g; |
| 89 |
$s .= $value; |
$s .= $value; |
| 90 |
} |
} |
| 91 |
} elsif ($nt == 8) { |
} elsif ($nt == 8) { |
| 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 |
| 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. |