33 lines
1.0 KiB
Lua
33 lines
1.0 KiB
Lua
local function isPatrologiaReference(first, second, third, last)
|
||
return first.t == 'Emph'
|
||
and (
|
||
(
|
||
#first.content == 3
|
||
and string.match(first.content[1].text, '^Patrologi[ea]$')
|
||
and first.content[2].t == 'Space'
|
||
and first.content[3].t == 'Str'
|
||
and string.match('|grecque|Graeca|latine|Latina|orientale|orientalis|', '|' .. first.content[3].text .. '|')
|
||
)
|
||
or
|
||
(
|
||
#first.content == 1
|
||
and first.content[1].t == 'Str'
|
||
and string.match('|PG|PL|PO|', '|' .. first.content[1].text .. '|')
|
||
)
|
||
)
|
||
and (second.t == 'Str'
|
||
and string.match(second.c, '^ [0-9]+,$')
|
||
and third.t == 'Space'
|
||
and last.t == 'Str'
|
||
and string.match(last.c, '^col. $'))
|
||
end
|
||
|
||
function Inlines (inlines)
|
||
for i = #inlines, 6, -1 do
|
||
if isPatrologiaReference(inlines[i-3], inlines[i-2], inlines[i-1], inlines[i]) then
|
||
inlines:remove(i)
|
||
end
|
||
end
|
||
return inlines
|
||
end
|