Skip to content

Commit a75e810

Browse files
committed
Regression Pandoc 3.3
Add zotero-SuppressAuthor.lua (is Pandoc 3.4)
1 parent 26d0324 commit a75e810

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
--- translate-zotero.lua – filter to translate elements
2+
--- https://github.com/estedeahora/guri/tree/main/inst/files-pkg/filters/translate-zotero.lua
3+
--- The filter is part of the R package {guri}.
4+
---
5+
--- Copyright: © 2024 Pablo Santiago SERRATI
6+
--- License: CC-by-nc-sa. The licence for this filter is the same as for the {guri} package
7+
--- (see https://github.com/estedeahora/guri/).
8+
9+
-- Summary:
10+
-- The translate-zotero.lua is a Pandoc Lua filter that translates citation elements (coming
11+
-- from zotero plug-in for word in 'fields').
12+
13+
local stringify = pandoc.utils.stringify
14+
15+
function Cite(cite)
16+
17+
local cite_text = stringify(cite)
18+
19+
for k, citation in ipairs(cite.citations) do
20+
prefix = stringify(citation.prefix)
21+
if #prefix > 0 then
22+
prefix = stringify(citation.prefix) .. " "
23+
end
24+
if cite_text:match('^%(' .. prefix .. '[0-9][0-9][0-9]') then
25+
citation.mode = "SuppressAuthor"
26+
end
27+
end
28+
29+
return cite
30+
end

0 commit comments

Comments
 (0)