Avoid doubled labels.

The null identifier for spans is the empty string, not nil.
This commit is contained in:
Bastien Dumont
2025-12-18 23:22:43 +01:00
parent 2eef26a5d9
commit 078b6ae71e

View File

@ -216,11 +216,11 @@ local function control_label_placement(span)
local id = span.identifier
if label_placement == 'end' then
span.content:insert(pandoc.Span({}, { id = id }))
span.identifier = nil
span.identifier = ''
elseif label_placement == 'both' then
span.content:insert(1, pandoc.Span({}, { id = id .. '-beg' })) -- for DOCX/ODT
span.content:insert(pandoc.Span({}, { id = id .. '-end' }))
span.identifier = nil
span.identifier = ''
elseif label_placement ~= 'beg' then
warning('Invalid value ' .. label_placement .. ' on attribute ' .. PLACE_LABEL_ATTR .. ': ' ..
'shoud be “beg” (default), “end” of “both”. Using the defaults.')