Adjust to_text interface

This commit is contained in:
Marcel Fabian Krüger 2021-05-01 08:03:21 +02:00
parent 5f9d522244
commit 64d5adfb33
4 changed files with 4 additions and 4 deletions

View File

@ -43,7 +43,7 @@ token.set_lua('__luamml_amsmath_save_tag:', funcid, 'protected')
lua.get_functions_table()[funcid] = function() lua.get_functions_table()[funcid] = function()
local nest = tex.nest.top local nest = tex.nest.top
local chars = {} local chars = {}
last_tag = {[0] = 'mtext', to_text(nest.head)} last_tag = to_text(nest.head)
end end
funcid = luatexbase.new_luafunction'__luamml_amsmath_set_tag:' funcid = luatexbase.new_luafunction'__luamml_amsmath_set_tag:'

View File

@ -48,7 +48,7 @@ lua.get_functions_table()[funcid] = function()
else else
-- Oh no, we got text. Let't complain to the user, it's probably their fault -- Oh no, we got text. Let't complain to the user, it's probably their fault
print'We are mathematicians, don\'t bother us with text' print'We are mathematicians, don\'t bother us with text'
store_column_xml{[0] = 'mtext', to_text(startmath, tex.nest.top.tail)} store_column_xml(to_text(startmath, tex.nest.top.tail))
end end
end end

View File

@ -89,7 +89,7 @@ local function kernel_to_table(kernel, cur_style)
return result, result return result, result
elseif id == sub_box_t then elseif id == sub_box_t then
if kernel.list.id == hlist_t then -- We directly give up for vlists if kernel.list.id == hlist_t then -- We directly give up for vlists
local result = {[0] = 'mtext', to_text(kernel.list.head)} local result = to_text(kernel.list.head)
return result, result return result, result
else else
local result = {[0] = 'mi', {[0] = 'mglyph', ['tex:box'] = kernel.list}} local result = {[0] = 'mi', {[0] = 'mglyph', ['tex:box'] = kernel.list}}

View File

@ -57,7 +57,7 @@ local function to_unicode(head, tail)
end -- CHECK: Everything else can probably be ignored, otherwise shout at me end -- CHECK: Everything else can probably be ignored, otherwise shout at me
end end
end end
return table.concat(result) return {[0] = 'mtext', table.concat(result)}
end end
return to_unicode return to_unicode