summaryrefslogtreecommitdiff
path: root/tex/context/base/util-jsn.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/util-jsn.lua')
-rw-r--r--tex/context/base/util-jsn.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/tex/context/base/util-jsn.lua b/tex/context/base/util-jsn.lua
index 6ca956c02..101a75d6b 100644
--- a/tex/context/base/util-jsn.lua
+++ b/tex/context/base/util-jsn.lua
@@ -107,7 +107,9 @@ local function tojson(value,t) -- we could optimize #t
end
t[#t+1] = "]"
end
- elseif kind == "string" or kind == "number" then
+ elseif kind == "string" then
+ t[#t+1] = format("%q",value)
+ elseif kind == "number" then
t[#t+1] = value
else
t[#t+1] = tostring(value)