Skip Menu |

This queue is for tickets about the HTML-Zoom CPAN distribution.

Report information
The Basics
Id: 84575
Status: new
Priority: 0/
Queue: HTML-Zoom

People
Owner: Nobody in particular
Requestors: lxp [...] cpan.org
Cc:
AdminCc:

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



Subject: prepend_content in HTML::Zoom::FilterBuilder not accepting scalar refs
The documentation for prepend_content in HTML::Zoom::FilterBuilder states that "acceptable values are strings, scalar refs and HTML::Zoom objects." It gives the following example using a string: Show quoted text
> HTML::Zoom > ->from_html(q[<p>World</p>]) > ->select('p') > ->prepend_content("Hello ") > ->to_html > > ## expected/actual: <p>Hello World</p>
If I'm reading the documentation correctly, it should be possible to achieve the same result if "Hello " is replaced with \"Hello " but the same result is not achieved: Show quoted text
> HTML::Zoom > ->from_html(q[<p>World</p>]) > ->select('p') > ->prepend_content(\"Hello ") > ->to_html > > ## expected: <p>Hello World</p> > ## actual: <p>World</p>
Specifically, I'm trying to replace_content but not have that content escaped: Show quoted text
> HTML::Zoom > ->from_html('<span>...</span>') > ->select('span') > ->replace_content(\'&minus;123.45') > ->to_html > > ## expected: <span>&minus;123.45</span> > ## actual: <span></span>
The docs don't explicitly permit use of scalar refs in replace_content; is this meant to be possible? If so, this issue extends to that method as well.