move actualtext to the mc-chunk

This commit is contained in:
Ulrike Fischer 2024-12-11 15:02:56 +01:00
parent c53fb2a956
commit a2fa1d4dcf
2 changed files with 12 additions and 8 deletions

View File

@ -7,6 +7,9 @@ this project uses date-based 'snapshot' version identifiers.
## [Unreleased] ## [Unreleased]
### Changed ### Changed
- Ulrike Fischer, 2024-11-29
luamml-structelemwriter.lua: moved the actualtext for e.g. stretched braces from the structure element to the mc-chunk.
- Ulrike Fischer, 2024-03-03 - Ulrike Fischer, 2024-03-03
luamml.dtx: add plug for mbox socket to correctly annotate them in math. luamml.dtx: add plug for mbox socket to correctly annotate them in math.

View File

@ -89,18 +89,19 @@ local function write_elem(tree, stash)
tex.sprint(struct_begin, '{tag=' .. tree[0] .. '/mathml') tex.sprint(struct_begin, '{tag=' .. tree[0] .. '/mathml')
if stash then tex.sprint(stash) end if stash then tex.sprint(stash) end
if attr_flag then tex.sprint(attr_flag) end if attr_flag then tex.sprint(attr_flag) end
if tree[':actual'] then
tex.sprint(', actualtext = {')
tex.cprint(12, tree[':actual'])
tex.sprint'}'
end
tex.sprint'}' tex.sprint'}'
for j = 1, i do attrs[j] = nil end for j = 1, i do attrs[j] = nil end
if tree[':nodes'] then if tree[':nodes'] then
local n = tree[':nodes'] local n = tree[':nodes']
tex.runtoks(function() tex.runtoks(function()
if tree[':actual'] then
tex.sprint(mc_begin,'{tag=Span,actualtext=')
tex.cprint(12,tree[':actual'])
tex.sprint('}')
else
tex.sprint{mc_begin, string.format('{tag=%s}', tree[0])} tex.sprint{mc_begin, string.format('{tag=%s}', tree[0])}
end
-- NOTE: This will also flush all previous sprint's... That's often annoying, but in this case actually intentional. -- NOTE: This will also flush all previous sprint's... That's often annoying, but in this case actually intentional.
end) end)
local mct, mcc = tex.attribute[mc_type], tex.attribute[mc_cnt] local mct, mcc = tex.attribute[mc_type], tex.attribute[mc_cnt]