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:
parent
851e0b1e4b
commit
37549af48b
|
@ -19,9 +19,9 @@
|
||||||
]]--
|
]]--
|
||||||
|
|
||||||
local function isLineIndication(first, middle, last)
|
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 middle.t == 'Space'
|
||||||
and first.t == 'Str' and string.match(first.c, '.+,$')
|
and first.t == 'Str' and string.match(first.text, '.+,$')
|
||||||
end
|
end
|
||||||
|
|
||||||
local function isCommaAfterLineIndication(lineIndication)
|
local function isCommaAfterLineIndication(lineIndication)
|
||||||
|
@ -31,10 +31,10 @@ end
|
||||||
function Inlines (inlines)
|
function Inlines (inlines)
|
||||||
for i = #inlines, 3, -1 do
|
for i = #inlines, 3, -1 do
|
||||||
if isLineIndication(inlines[i-2], inlines[i-1], inlines[i]) then
|
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, '^[^,]+')
|
inlines[i-2].text = string.match(firstString, '^[^,]+')
|
||||||
if isCommaAfterLineIndication(inlines[i].c) then
|
if isCommaAfterLineIndication(inlines[i].text) then
|
||||||
inlines[i].text = string.match(inlines[i].c, '^[^,]+')
|
inlines[i].text = string.match(inlines[i].text, '^[^,]+')
|
||||||
inlines:insert(i+1, pandoc.Str(','))
|
inlines:insert(i+1, pandoc.Str(','))
|
||||||
end
|
end
|
||||||
inlines[i] = pandoc.Superscript(pandoc.Str(string.sub(inlines[i].text, 5)))
|
inlines[i] = pandoc.Superscript(pandoc.Str(string.sub(inlines[i].text, 5)))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user