Skip Menu |

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

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

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

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



To: bug-XML-Twig [...] rt.cpan.org
Subject: subs_text generating entities sub's too much
Date: Tue, 12 Jul 2005 15:34:38 -0700
From: ddascalescu [...] gmail.com
I was trying to convert base entities back from their expanded form into proper entities, using XML::Twig 1.213 2005/06/28 09:53:02, and failing that, I tried the subs_text example from the development version documentation: my $twig= new XML::Twig->parse("<p>gone\n still here</p>"); print "Before:\n", $twig->sprint; $twig->subs_text( qr{ }, '&ent( "&nbsp;")'); print "\n\nAfter: ", $twig->sprint; It looks like subs_text replaces each character in the "gone" string from the <p> element with an "&nbsp;" entity. If you remove the "\n" from the text of the element, the substitution will work properly. The problem I had with the base entities was similar: $twig->parse("<p>text\nthe newline causes &lt; trouble.</p>"); print "\n\nBefore:\n", $twig->sprint; $twig->subs_text(qr/</, '&ent( "&lt;")'); print "\n\nAfter: ", $twig->sprint; Hope this helps, Dan Dascalescu
Good catch. There was a missing s modifier on a regexp, so the replacement did not work as advertised. It's fixed in the dvelopment version now, let me know if it works for you. Thanks __ mirod
[MIROD - Wed Jul 13 02:04:59 2005]: Show quoted text
> Good catch. There was a missing s modifier on a regexp, so the > replacement did not work as advertised. > > It's fixed in the dvelopment version now, let me know if it works for you.
As I did not hear from you, I assumed the bug was fixed. So I am closing it. __ mirod