summaryrefslogtreecommitdiff
path: root/src/pugixml.cpp
diff options
context:
space:
mode:
authorArseny Kapoulkine <arseny.kapoulkine@gmail.com>2016-04-14 00:30:24 -0700
committerArseny Kapoulkine <arseny.kapoulkine@gmail.com>2016-04-14 00:30:24 -0700
commit2e0ed8284b7488f9664bf8dba9aae90688862cc3 (patch)
treedf01542bd9a856144ba1bd8f3e2bc1d444c7478a /src/pugixml.cpp
parentc6539ccef04ded1427831aa58404635af22e7634 (diff)
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.
Diffstat (limited to 'src/pugixml.cpp')
-rw-r--r--src/pugixml.cpp5
1 files changed, 4 insertions, 1 deletions
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;
}