Skip Menu |
 

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

Report information
The Basics
Id: 125304
Status: rejected
Priority: 0/
Queue: XML-Twig

People
Owner: MIROD [...] cpan.org
Requestors: chrispitude [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 3.52
Fixed in: (no value)



Subject: > HTML metacharacters in text are not preserved
Download (untitled) / with headers
text/plain 428b
We use HTML metacharacters in our text content. The &lt; (<) metacharacter is preserved, but the &gt; (>) metacharacter is not. You can reproduce this with the following short perl script: ==== #!/usr/bin/perl use strict; use warnings; use XML::Twig; my $t=XML::Twig->new(); $t->parse('<pre>&lt;hello&gt;</pre>'); $t->print(pretty_print => 'indented'); ==== The output is: <pre>&lt;hello></pre> ^ not escaped
Download (untitled) / with headers
text/plain 139b
Although - is this still valid/equivalent XML syntax, because the leading bracket is escaped and thus the trailing one does not have to be?
Download (untitled) / with headers
text/plain 424b
On Sat May 12 11:08:15 2018, chrispitude@gmail.com wrote: Show quoted text
> Although - is this still valid/equivalent XML syntax, because the > leading bracket is escaped and thus the trailing one does not have to > be?
Yes, escaping '>' is not needed, it is always valid (except in one edge case with CDATA sections). You can use the escape_gt option when you create the XML::Twig object to change the default behavior though. __ mirod
Download (untitled) / with headers
text/plain 151b
Thanks! Then this is user error, as the behavior is valid *and* it is controllable. I have changed the status to 'rejected' (I hope this is correct!).


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.