Subject: | Missing entities on parsing |
Date: | Fri, 07 Mar 2014 11:55:16 +0100 |
To: | bug-XML-Twig [...] rt.cpan.org |
From: | Marco Pessotto <melmothx [...] gmail.com> |
Hello and thanks for the new XML::Twig releases.
I have the following test which shows a bad escaping (maybe related to
the old #86633).
#!perl
use strict;
use warnings;
use Test::More tests => 1;
use XML::Twig 3.45;
diag "Version " . $XML::Twig::VERSION;
my $parser = XML::Twig->new();
# this looks like valid html snippet to me
my $value =<< 'EOF';
<h1>Here&there v&r;</h1><p>marco&company;</p>
EOF
my $html = $parser->safe_parse_html($value);
like $html->sprint, qr{\Q$value\E}, "In and out are the same";
__END__
Which gives the following output:
1..1
# Version 3.46
not ok 1 - In and out are the same
# Failed test 'In and out are the same'
# at prova.t line 19.
# '<html><head></head><body><h1>Herethere v&r;</h1><p>marco&company;</p></body></html>'
# doesn't match '(?^:<h1>Here&there v&r;</h1><p>marco&company;</p>
# )'
# Looks like you failed 1 test of 1
As you can see, Here&there became Herethere.
Ideas?
Best wishes
--
Marco