|P is for Practical
Re^2: Seemingly Valid HTML which crashes HTML::TreeBuilder::XPathby mldvx4 (Friar)
|on Nov 10, 2023 at 11:38 UTC
Would there be a better way of handling the character data (CDATA) found in odd places in the HTML?
What I am trying to do is lift the contents out of an element. Specifically, HTML Tidy adds a body element around any elements and CDATA in a document so,
would then after processing become
This is so the block which had been body can be inserted into another document, without that new document ending up with multiple body elements. One alternative would have been to change the body to div, but then multiple passes though the work flow would cause multiple, unnecessary, nested div elements. Therefore it seems like the only option is to remove the element completely and leave just its contents.