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(\'−123.45')
> ->to_html
>
> ## expected: <span>−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.