[libxml2] Don't add formatting newlines to XInclude nodes



commit 00a86d414ba9a9e1cd588182b87518e4e3af9466
Author: Nick Wellnhofer <wellnhofer aevum de>
Date:   Sun Aug 16 23:38:00 2020 +0200

    Don't add formatting newlines to XInclude nodes

 xmlsave.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/xmlsave.c b/xmlsave.c
index f1d40b9b7..2225628dc 100644
--- a/xmlsave.c
+++ b/xmlsave.c
@@ -1049,7 +1049,9 @@ xmlNodeDumpOutputInternal(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) {
         while (1) {
             if (cur == root)
                 return;
-            if (ctxt->format == 1)
+            if ((ctxt->format == 1) &&
+                (cur->type != XML_XINCLUDE_START) &&
+                (cur->type != XML_XINCLUDE_END))
                 xmlOutputBufferWrite(buf, 1, "\n");
             if (cur->next != NULL) {
                 cur = cur->next;
@@ -1224,7 +1226,9 @@ xmlDocContentDumpOutput(xmlSaveCtxtPtr ctxt, xmlDocPtr cur) {
                else
 #endif
                    xmlNodeDumpOutputInternal(ctxt, child);
-               xmlOutputBufferWrite(buf, 1, "\n");
+                if ((child->type != XML_XINCLUDE_START) &&
+                    (child->type != XML_XINCLUDE_END))
+                    xmlOutputBufferWrite(buf, 1, "\n");
                child = child->next;
            }
        }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]