diff options
Diffstat (limited to 'dviware/dvisvgm/src/XMLNode.cpp')
-rw-r--r-- | dviware/dvisvgm/src/XMLNode.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/dviware/dvisvgm/src/XMLNode.cpp b/dviware/dvisvgm/src/XMLNode.cpp index eb49b9c9db..8549593a13 100644 --- a/dviware/dvisvgm/src/XMLNode.cpp +++ b/dviware/dvisvgm/src/XMLNode.cpp @@ -2,7 +2,7 @@ ** XMLNode.cpp ** ** ** ** This file is part of dvisvgm -- a fast DVI to SVG converter ** -** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> ** +** Copyright (C) 2005-2021 Martin Gieseking <martin.gieseking@uos.de> ** ** ** ** This program is free software; you can redistribute it and/or ** ** modify it under the terms of the GNU General Public License as ** @@ -107,7 +107,7 @@ void XMLElement::addAttribute (const string &name, const string &value) { if (Attribute *attr = getAttribute(name)) attr->value = value; else - _attributes.emplace_back(Attribute(name, value)); + _attributes.emplace_back(name, value); } @@ -387,12 +387,12 @@ ostream& XMLElement::write (ostream &os) const { os << '>'; // Insert newlines around children except text nodes. According to the // SVG specification, pure whitespace nodes are ignored by the SVG renderer. - if (WRITE_NEWLINES && !_firstChild->toText()) + if (WRITE_NEWLINES && name() != "text" && !_firstChild->toText()) os << '\n'; for (XMLNode *child = _firstChild.get(); child; child = child->next()) { child->write(os); if (!child->toText()) { - if (WRITE_NEWLINES && (!child->next() || !child->next()->toText())) + if (WRITE_NEWLINES && name() != "text" && (!child->next() || !child->next()->toText())) os << '\n'; } } |