One - since decoding/encoding is reversible:

Unfortunately, this isn't an option. It might well be that the raw HTML contains both encoded as unencoded entities. As in the end I'll need my code to be part of an filter, I'd really need the raw, original text, in order to be able to substitute it when and how appropiate.

As to hacking the source modules - I didn't succeed, and I'm not even really sure I can accomplish that, as decoding is done by HTML::Parser in it's C-code part.

HTML::Parser offers a method to get the raw attributes - $p->attr_encoded sets a boolean flag when a new parser is built - but I didn't find yet a way to use it via HTML::TreeBuilder.

Thank you, anyway.

In reply to Re^2: How to get undecoded html entities with HTML::TreeBuilder by Krambambuli
in thread How to get undecoded html entities with HTML::TreeBuilder by Krambambuli

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.