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 => 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('');