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