summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2015-03-20 10:58:11 +0100
committertv <tv@krebsco.de>2019-02-16 17:29:09 +0100
commit3a25fe69295e477ea103ab7010e2a43e37191c62 (patch)
tree369a2edadf6ede1fbcb72ff221b63efa83ec44b8 /lib
parentfe08236da659ff27eda98c6170fabbf981455c80 (diff)
lib.xml.render-term: quote strings
Diffstat (limited to 'lib')
-rw-r--r--lib/xml.nix8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/xml.nix b/lib/xml.nix
index 92f5521..1605244 100644
--- a/lib/xml.nix
+++ b/lib/xml.nix
@@ -68,12 +68,16 @@ rec {
bool = toJSON content;
int = toJSON content;
list = concatMapStrings render content;
- string = content;
+ string = quote content;
};
in
{ name, attrs, content }:
+ # XXX we're currently encoding too much information with `null`..
if name == null
- then ""
+ then
+ if content == null
+ then ""
+ else content
else let
attrs' = render-attrs attrs;
content' = render-content content;