Fix supplied ref=CITEREF error when item has editors but no authors

This commit is contained in:
Jonathan Harker 2026-10-20 11:48:18 +13:00
parent d2e75d6e21
commit 0dfb7e26e1

View file

@ -901,7 +901,13 @@ local function _cite_q (citeq_args)
if names.authors_overridden or (#names.authors == 0 and names.editors_overridden) then
-- if names are supplied manually, then don't mess with supplied ref parameter
elseif citeq_args.ref and 'none' ~= citeq_args.ref then
local citeref = make_citeref(names.authors or names.editors, pubyear)
local refnames
if #names.authors > 0 then
refnames = names.authors
else
refnames = names.editors
end
local citeref = make_citeref(refnames, pubyear)
if citeq_args.ref == citeref then
citeq_args.ref = nil -- avoid CS1 maint: ref duplicates default
else