diff options
Diffstat (limited to 'tex/context/base/mkiv/java-ini.lua')
-rw-r--r-- | tex/context/base/mkiv/java-ini.lua | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tex/context/base/mkiv/java-ini.lua b/tex/context/base/mkiv/java-ini.lua index 61ab15e7a..a8868da60 100644 --- a/tex/context/base/mkiv/java-ini.lua +++ b/tex/context/base/mkiv/java-ini.lua @@ -8,7 +8,7 @@ if not modules then modules = { } end modules ['java-ini'] = { -- todo: don't flush scripts if no JS key -local format = string.format +local format, gsub, find = string.format, string.gsub, string.find local concat = table.concat local lpegmatch, P, S, C, Carg, Cc = lpeg.match, lpeg.P, lpeg.S, lpeg.C, lpeg.Carg, lpeg.Cc @@ -69,6 +69,7 @@ local parsefunctions = (fname + any)^0 function javascripts.storecode(str) local name, uses, script = lpegmatch(parsecode,str) if name and name ~= "" then + script = gsub(script,"%s*([^\n\r]+)%s*[\n\r]+$","%1") codes[name] = { uses, script } end end |