libxml-raku / LibXML-raku

Raku bindings to the libxml2 native library
Artistic License 2.0
11 stars 5 forks source link

Questionable `htmlDoc.dump()` and `LibXML::Document.serialize-html` implementations #90

Closed dwarring closed 1 year ago

dwarring commented 1 year ago

Just looking at this in more detail.

So its both setting the encoding and mutating the raw type of the document.

dwarring commented 1 year ago

I suspect we're better of to call htmlNodeDumpFormatOutput directly.

Calling serialize-html on a non-html document should either be protected (with the document type temporarily changed), or deprecated.

dwarring commented 1 year ago

Fixed in LibXML 0.94 release. This serializes HTML via the more modern xmlSaveTree() with the XML_SAVE_XHTML flag set.