mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-22 22:16:16 +02:00
* Escape newlines in XML attributes to prevent them from being
normalised away.
This commit is contained in:
parent
215ec2ddc6
commit
3e8dccf6ab
1 changed files with 3 additions and 0 deletions
|
@ -89,6 +89,9 @@ void XMLWriter::writeAttrs(const XMLAttrs & attrs)
|
|||
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;
|
||||
}
|
||||
output << "\"";
|
||||
|
|
Loading…
Reference in a new issue