Compare commits
No commits in common. "743d8f85c59222fe7236c09e042ff2ae08cfb131" and "246ae13e4e26eb828f9242d42e8a8dc7b6ce8310" have entirely different histories.
743d8f85c5
...
246ae13e4e
@ -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(to_text(startmath, tex.nest.top.tail)).columnalign = alignment
|
store_column_xml(to_text(startmath, tex.nest.top.tail))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -34,25 +34,14 @@ local function to_unicode(head, tail)
|
|||||||
subresult[i] = '\u{FFFD}'
|
subresult[i] = '\u{FFFD}'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
elseif node.id'math' == id then
|
-- elseif node.id'math' == id then
|
||||||
if props then
|
-- n = node.end_of_math(n) -- Not sure yet
|
||||||
local mml = props.saved_mathml_table
|
|
||||||
if mml then
|
|
||||||
if i ~= 0 then
|
|
||||||
result[#result+1] = {[0] = 'mtext', table.concat(subresult)}
|
|
||||||
for j = i, 1, -1 do subresult[j] = nil end
|
|
||||||
i = 0
|
|
||||||
end
|
|
||||||
result[#result+1] = mml
|
|
||||||
n = node.end_of_math(n)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
-- elseif node.id'whatsit' == id then
|
-- elseif node.id'whatsit' == id then
|
||||||
-- TODO(?)
|
-- TODO(?)
|
||||||
elseif node.id'glue' == id then
|
elseif node.id'glue' == id then
|
||||||
if n.width > 1000 then -- FIXME: Coordinate constant with tagpdf
|
if n.width > 1000 then -- FIXME: Coordinate constant with tagpdf
|
||||||
i = i+1
|
i = i+1
|
||||||
subresult[i] = '\u{00A0}' -- non breaking space... There is no real reason why it has to be non breaking, except that MathML often ignore other spaces
|
subresult[i] = ' '
|
||||||
end
|
end
|
||||||
elseif node.id'hlist' == id then
|
elseif node.id'hlist' == id then
|
||||||
local nested = to_unicode(n.head)
|
local nested = to_unicode(n.head)
|
||||||
@ -61,13 +50,12 @@ local function to_unicode(head, tail)
|
|||||||
subresult[i] = nested[1]
|
subresult[i] = nested[1]
|
||||||
else
|
else
|
||||||
if i ~= 0 then
|
if i ~= 0 then
|
||||||
result[#result+1] = {[0] = 'mtext', table.concat(subresult)}
|
|
||||||
for j = i, 1, -1 do subresult[j] = nil end
|
|
||||||
i = 0
|
i = 0
|
||||||
|
result[#result+1] = {[0] = 'mtext', table.concat(subresult)}
|
||||||
end
|
end
|
||||||
if nested[0] == 'mrow' then
|
if nested[0] == 'mrow' then
|
||||||
table.move(nested, 1, #nested, #result+1, result)
|
table.move(nested, 1, #nested, #result+1, result)
|
||||||
else -- should be unreachable (propbably actually is reachable if the inner list only contains math
|
else -- should be unreachable
|
||||||
result[#result+1] = nested
|
result[#result+1] = nested
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -83,6 +71,7 @@ local function to_unicode(head, tail)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
if i ~= 0 then
|
if i ~= 0 then
|
||||||
|
i = 0
|
||||||
result[#result+1] = {[0] = 'mtext', table.concat(subresult)}
|
result[#result+1] = {[0] = 'mtext', table.concat(subresult)}
|
||||||
end
|
end
|
||||||
if #result == 0 then
|
if #result == 0 then
|
||||||
|
Loading…
Reference in New Issue
Block a user