Skip Menu |

This queue is for tickets about the XML-Twig CPAN distribution.

Report information
The Basics
Id: 93604
Status: resolved
Priority: 0/
Queue: XML-Twig

People
Owner: Nobody in particular
Requestors: melmothx [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 3.48
Fixed in: (no value)



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&amp;there v&amp;r;</h1><p>marco&amp;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&amp;r;</h1><p>marco&amp;company;</p></body></html>' # doesn't match '(?^:<h1>Here&amp;there v&amp;r;</h1><p>marco&amp;company;</p> # )' # Looks like you failed 1 test of 1 As you can see, Here&amp;there became Herethere. Ideas? Best wishes -- Marco
Subject: Re: [rt.cpan.org #93604] Missing entities on parsing
Date: Fri, 07 Mar 2014 14:54:37 +0100
To: bug-XML-Twig [...] rt.cpan.org
From: mirod <xmltwig [...] gmail.com>
Yep, It looks like my _as_XML method is wrong there. I'll have a look at it this WE. Thanks for the report. -- mirod On 03/07/2014 11:55 AM, Marco Pessotto via RT wrote: Show quoted text
> Fri Mar 07 05:55:33 2014: Request 93604 was acted upon. > Transaction: Ticket created by melmothx@gmail.com > Queue: XML-Twig > Subject: Missing entities on parsing > Broken in: (no value) > Severity: (no value) > Owner: Nobody > Requestors: melmothx@gmail.com > Status: new > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=93604 > > > > > 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&amp;there v&amp;r;</h1><p>marco&amp;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&amp;r;</h1><p>marco&amp;company;</p></body></html>' > # doesn't match '(?^:<h1>Here&amp;there v&amp;r;</h1><p>marco&amp;company;</p> > # )' > # Looks like you failed 1 test of 1 > > > As you can see, Here&amp;there became Herethere. > > Ideas? > > Best wishes >
It should be fixed in XML::Twig 3.47 It should be on CPAN soon, or you can get it at http://xmltwig.org/xmltwig/. Let me know if it works for you. Thanks __ mirod