Subject: | marked_sections omit first 3 bytes "<![" from "skipped_text" |
When processing a document with "marked_sections => 1", the skipped text
misses the first 3 bytes "<![", as this program shows:
====== cut here ======
#!/usr/bin/perl
use HTML::Parser;
my $doc = "<Tag><![CDATA[This is cdata]]></Tag>";
my $result = "";
my $parser = HTML::Parser->new(
marked_sections => 1,
handlers => {
default => [ sub { $result .= join("",@_) }, "skipped_text,text" ]
}
)->parse($doc);
print "Version: $HTML::Parser::VERSION\n"; # prints: Version: 3.47
print "INPUT: $doc\n"; # prints: <Tag><![CDATA[This is cdata]]></Tag>
print "OUTPUT: $result\n"; # prints: <Tag>CDATA[This is cdata]]></Tag>
====== cut here ======