Skip Menu |

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

Report information
The Basics
Id: 8121
Status: resolved
Priority: 0/
Queue: HTML-Tree

People
Owner: PETDANCE [...] cpan.org
Requestors: dmaki [...] cpan.org
Cc:
AdminCc:

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



Subject: RFE: Optionally skip encoding entities
I'd like to use HTML::Tree to parse user-submitted HTML. The trick is that users need to access some dynamic data, so I'd like to allow them to insert "special" tags, which will be translated into some Template snippet by my pre-processor, before handing it over to TT2 I'd also like to filter out any unwanted HTML, as much as possible, such as javascript snippets. I'd like to use HTML::Tree for this purpose. I traverse the tree and remove all unwanted tags/attributes, and use ->as_HTML() to output the result. The problem I'm facing is that after the preprocessor and HTML::Tree finishes processing, I end up with garbled TT2 directives, for example [% INCLUDE foo.inc(blah =&gt 1) %] In essense, I don't want HTML::Element->as_HTML() to escape my characters. Would it be possible to change as_HTML such that by passing undef (or maybe ''), the entity encoding is skipped? Something like this: $tree->as_HTML(undef); $tree->as_HTML('');
From: dma_k [...] mail.ru
Show quoted text
> $tree->as_HTML('');
Seems like this functionality already exists in HTML::Element. This request can be closed, right?
This functionality already exists in HTML::Element.