From 2e0ed8284b7488f9664bf8dba9aae90688862cc3 Mon Sep 17 00:00:00 2001
From: Arseny Kapoulkine <arseny.kapoulkine@gmail.com>
Date: Thu, 14 Apr 2016 00:30:24 -0700
Subject: Remove extra space in an empty tag for format_raw

When using format_raw the space in the empty tag (<node />) is the only
character that does not have to be there; so format_raw almost results in
a minimal XML but not quite.

It's pretty unlikely that this is crucial for any users - the formatting
change should be benign, and it's better to improve format_raw than to add
yet another flag.

Fixes #87.
---
 src/pugixml.cpp | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

(limited to 'src')

diff --git a/src/pugixml.cpp b/src/pugixml.cpp
index ee573c6..e8c10a7 100644
--- a/src/pugixml.cpp
+++ b/src/pugixml.cpp
@@ -4014,7 +4014,10 @@ PUGI__NS_BEGIN
 		{
 			if (!node->first_child)
 			{
-				writer.write(' ', '/', '>');
+				if ((flags & format_raw) == 0)
+					writer.write(' ');
+
+				writer.write('/', '>');
 
 				return false;
 			}
-- 
cgit v1.2.3