commit 7ba32c2f66c099364395c674ff7e2583b80115ac
parent 8d6b28b556324270f1c36c468887eaeb5777d426
Author: Dominik Schmidt <doeme@bastli.ethz.ch>
Date: Wed, 5 Sep 2018 01:08:59 +0200
Escape the name string in JSON_to_GROFF.lua
Diffstat:
1 file changed, 2 insertions(+), 0 deletions(-)
diff --git a/pipeline/10_JSON_to_GROFF.lua b/pipeline/10_JSON_to_GROFF.lua
@@ -14,6 +14,8 @@ function getPositions()
local total=0
for _,a in pairs(j["articles"]) do
local escname=a["name"]
+ escname=string.gsub(escname,"\\","\\\\")
+ escname=string.gsub(escname,"\n","\n\\&")
local subtot=a["price"]*a["amount"]
total=total+subtot
str=str..string.format("%d\tT{\n%s\nT}\t%.2f\n", a["amount"], escname, subtot)