Remplacement du champ "c" (qui existait mais n'était pas documenté, et a été supprimé) par le champ "text" dans les manipulations de Str

This commit is contained in:
Bastien Dumont 2022-01-09 21:55:51 +01:00
parent 851e0b1e4b
commit 37549af48b

View File

@ -19,9 +19,9 @@
]]--
local function isLineIndication(first, middle, last)
return last.t == 'Str' and string.match(last.c, '^l. [^,]+,?$')
return last.t == 'Str' and string.match(last.text, '^l. [^,]+,?$')
and middle.t == 'Space'
and first.t == 'Str' and string.match(first.c, '.+,$')
and first.t == 'Str' and string.match(first.text, '.+,$')
end
local function isCommaAfterLineIndication(lineIndication)
@ -31,10 +31,10 @@ end
function Inlines (inlines)
for i = #inlines, 3, -1 do
if isLineIndication(inlines[i-2], inlines[i-1], inlines[i]) then
firstString = inlines[i-2].c
firstString = inlines[i-2].text
inlines[i-2].text = string.match(firstString, '^[^,]+')
if isCommaAfterLineIndication(inlines[i].c) then
inlines[i].text = string.match(inlines[i].c, '^[^,]+')
if isCommaAfterLineIndication(inlines[i].text) then
inlines[i].text = string.match(inlines[i].text, '^[^,]+')
inlines:insert(i+1, pandoc.Str(','))
end
inlines[i] = pandoc.Superscript(pandoc.Str(string.sub(inlines[i].text, 5)))