From 913b7150e1ebf23a002d621581a47d9a507d3c24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcel=20Fabian=20Kr=C3=BCger?= Date: Tue, 18 May 2021 21:01:48 +0200 Subject: [PATCH] Enable indentation / newlines in MathML writer --- luamml-tex.lua | 2 +- luamml-xmlwriter.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/luamml-tex.lua b/luamml-tex.lua index 24b0072..1ccea18 100644 --- a/luamml-tex.lua +++ b/luamml-tex.lua @@ -50,7 +50,7 @@ local function save_result(xml, display) local filename = token.scan_argument() if filename ~= '' then assert(io.open(filename, 'w')) - :write(write_xml(make_root({[0] = 'mrow', xml}, display and 0 or 2)) .. '\n') + :write(write_xml(make_root({[0] = 'mrow', xml}, display and 0 or 2), true):sub(2) .. '\n') :close() end if tex.count.tracingmathml > 1 then diff --git a/luamml-xmlwriter.lua b/luamml-xmlwriter.lua index 4f06842..38884ba 100644 --- a/luamml-xmlwriter.lua +++ b/luamml-xmlwriter.lua @@ -46,5 +46,5 @@ end return function(element, indent, version) return (version == '11' and '' or '') .. - write_elem(element, indent and '' or nil) + write_elem(element, indent and '\n' or nil) end