diff --git a/module_citeq.lua b/module_citeq.lua index 5fb6b18..9061589 100644 --- a/module_citeq.lua +++ b/module_citeq.lua @@ -184,7 +184,7 @@ local function makelink(v, out, link, maxpos, wdl, namestyle) label = label, last = last_name or nil, first = first_names or nil, - qid = qnumber or nil, + qid = qnumber, } else out[position] = label @@ -206,7 +206,7 @@ local function makelink(v, out, link, maxpos, wdl, namestyle) label = label, last = last_name or nil, first = first_names or nil, - qid = qnumber or nil, + qid = qnumber, } else out[position] = label @@ -859,8 +859,11 @@ local function _cite_q (citeq_args) local missing_names = {} for i, author in pairs(names.authors or {}) do if not author.last and i <= (citeq_args['display-authors'] or author_count) then - if author.qid and author.qid == 'Q4233718' then + if author.qid then -- ignore anonymous + if author.qid ~= 'Q4233718' then + table.insert(missing_names, author.label .. " [[File:Wikidata-logo.svg|16px|alt=|link=[[:d:" .. author.qid .. "]] ]]") + end else table.insert(missing_names, author.label) end @@ -868,8 +871,11 @@ local function _cite_q (citeq_args) end for i, editor in pairs(names.editors or {}) do if not editor.last and i <= (citeq_args['display-editors'] or editor_count) then - if editor.qid and editor.qid == 'Q4233718' then + if editor.qid then -- ignore anonymous + if editor.qid ~= 'Q4233718' then + table.insert(missing_names, editor.label .. " [[File:Wikidata-logo.svg|16px|alt=|link=[[:d:" .. editor.qid .. "]] ]]") + end else table.insert(missing_names, editor.label) end @@ -877,8 +883,11 @@ local function _cite_q (citeq_args) end for i, translator in pairs(names.translators or {}) do if not translator.last then - if translator.qid and translator.qid == 'Q4233718' then + if translator.qid then -- ignore anonymous + if translator.qid ~= 'Q4233718' then + table.insert(missing_names, translator.label .. " [[File:Wikidata-logo.svg|16px|alt=|link=[[:d:" .. translator.qid .. "]] ]]") + end else table.insert(missing_names, translator.label) end