1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-10-23 01:52:48 +03:00

html: Add comment regarding hack for XML documents

This commit is contained in:
Nick Wellnhofer
2025-05-07 16:35:09 +02:00
parent f3a080bc48
commit 655ac5f851

View File

@@ -920,6 +920,15 @@ htmlDocContentDumpFormatOutput(xmlOutputBufferPtr buf, xmlDocPtr cur,
const char *encoding ATTRIBUTE_UNUSED,
int format) {
int type = 0;
/*
* This is needed when serializing XML documents as HTML.
* xmlEncodeEntitiesReentrant uses the document type to
* determine the serialization mode.
*
* Once we call more low-level functions directly with
* HTML flags, this hack can be removed.
*/
if (cur) {
type = cur->type;
cur->type = XML_HTML_DOCUMENT_NODE;