forked from lix-project/lix
* Escape newlines in XML attributes to prevent them from being
normalised away.
This commit is contained in:
parent
215ec2ddc6
commit
3e8dccf6ab
|
@ -89,6 +89,9 @@ void XMLWriter::writeAttrs(const XMLAttrs & attrs)
|
||||||
if (c == '"') output << """;
|
if (c == '"') output << """;
|
||||||
else if (c == '<') output << "<";
|
else if (c == '<') output << "<";
|
||||||
else if (c == '&') output << "&";
|
else if (c == '&') output << "&";
|
||||||
|
/* Escape newlines to prevent attribute normalisation (see
|
||||||
|
XML spec, section 3.3.3. */
|
||||||
|
else if (c == '\n') output << "
";
|
||||||
else output << c;
|
else output << c;
|
||||||
}
|
}
|
||||||
output << "\"";
|
output << "\"";
|
||||||
|
|
Loading…
Reference in a new issue