Enable indentation / newlines in MathML writer

This commit is contained in:
Marcel Fabian Krüger 2021-05-18 21:01:48 +02:00
parent 1046e096ed
commit 913b7150e1
2 changed files with 2 additions and 2 deletions

View File

@ -50,7 +50,7 @@ local function save_result(xml, display)
local filename = token.scan_argument() local filename = token.scan_argument()
if filename ~= '' then if filename ~= '' then
assert(io.open(filename, 'w')) 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() :close()
end end
if tex.count.tracingmathml > 1 then if tex.count.tracingmathml > 1 then

View File

@ -46,5 +46,5 @@ end
return function(element, indent, version) return function(element, indent, version)
return (version == '11' and '<?xml version="1.1"?>' or '') .. return (version == '11' and '<?xml version="1.1"?>' or '') ..
write_elem(element, indent and '' or nil) write_elem(element, indent and '\n' or nil)
end end