1From 054e46b097524d3808fdc0815b64e14beb2baaf9 Mon Sep 17 00:00:00 2001 2From: David Kilzer <ddkilzer@apple.com> 3Date: Sat, 14 May 2022 08:48:01 -0700 4Subject: [PATCH 288/300] Restore behavior of htmlDocContentDumpFormatOutput() 5 6Patch by J Pascoe of Apple. 7 8* HTMLtree.c: 9(htmlDocContentDumpFormatOutput): 10- Prior to commit b79ab6e6d92, xmlDoc.type was set to 11 XML_HTML_DOCUMENT_NODE before dumping the HTML output, then 12 restored before returning. 13 14Reference:https://github.com/GNOME/libxml2/commit/054e46b097524d3808fdc0815b64e14beb2baaf9 15Conflict:NA 16 17--- 18 HTMLtree.c | 7 +++++++ 19 1 file changed, 7 insertions(+) 20 21diff --git a/HTMLtree.c b/HTMLtree.c 22index 7a2b855..2e9fc57 100644 23--- a/HTMLtree.c 24+++ b/HTMLtree.c 25@@ -992,7 +992,14 @@ void 26 htmlDocContentDumpFormatOutput(xmlOutputBufferPtr buf, xmlDocPtr cur, 27 const char *encoding ATTRIBUTE_UNUSED, 28 int format) { 29+ int type = 0; 30+ if (cur) { 31+ type = cur->type; 32+ cur->type = XML_HTML_DOCUMENT_NODE; 33+ } 34 htmlNodeDumpFormatOutput(buf, cur, (xmlNodePtr) cur, NULL, format); 35+ if (cur) 36+ cur->type = (xmlElementType) type; 37 } 38 39 /** 40-- 412.27.0 42 43