From 0f2ae4f34d91953e3f0693b5452e7a2a145ceeca Mon Sep 17 00:00:00 2001 From: Jonathan Harker Date: Sun, 18 Oct 2026 08:35:00 +1300 Subject: [PATCH 1/5] fix citeref trim bug --- module_citeq.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/module_citeq.lua b/module_citeq.lua index f3a51ed..4dd248a 100644 --- a/module_citeq.lua +++ b/module_citeq.lua @@ -109,7 +109,8 @@ end local function make_citeref(names, year) local refs = {} for i, v in ipairs(names) do - refs[i] = mw.text.trim(v.last) or mw.text.trim(v.label) or '' + local name = v.last or v.label or '' + refs[i] = mw.text.trim(name) if i == 4 then break end end table.insert(refs, year) From 746e3a39470fb0229afc042181c6fc9c00e825c7 Mon Sep 17 00:00:00 2001 From: Trappist the monk Date: Mon, 19 Oct 2026 13:27:57 +1300 Subject: [PATCH 2/5] author count, compare numbers to numbers --- module_citeq.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module_citeq.lua b/module_citeq.lua index 4dd248a..2ffb327 100644 --- a/module_citeq.lua +++ b/module_citeq.lua @@ -826,7 +826,7 @@ local function _cite_q (citeq_args) local missing_names = {} for i, author in pairs(names.authors or {}) do -- mw.logObject(author) - if not author.last and i <= (citeq_args['display-authors'] or author_count) then + if not author.last and i <= (tonumber (citeq_args['display-authors']) or tonumber (author_count)) then if author.qid then -- ignore anonymous if author.qid ~= 'Q4233718' then From c259ed270484dd3fb96967d1a46b087ffaa16b16 Mon Sep 17 00:00:00 2001 From: Trappist the monk Date: Mon, 19 Oct 2026 13:29:44 +1300 Subject: [PATCH 3/5] ref=none is legitimate --- module_citeq.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module_citeq.lua b/module_citeq.lua index 2ffb327..b2dbb72 100644 --- a/module_citeq.lua +++ b/module_citeq.lua @@ -875,7 +875,7 @@ local function _cite_q (citeq_args) -- handle supplied {{para|ref}} for readable ID, avoid CS1 duplicate default error local pubyear = yearFromDate(citeq_args['publication-date']) - if citeq_args.ref then + if citeq_args.ref and 'none' ~= citeq_args.ref then local citeref = make_citeref(names.authors or names.editors, pubyear) if citeq_args.ref == citeref then citeq_args.ref = nil -- avoid CS1 maint: ref duplicates default From 3ff8162b8e50d2901f6533c5bcb6703bbdaaeccf Mon Sep 17 00:00:00 2001 From: Trappist the monk Date: Mon, 19 Oct 2026 13:31:21 +1300 Subject: [PATCH 4/5] editor count, compare numbers to numbers --- module_citeq.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module_citeq.lua b/module_citeq.lua index b2dbb72..409f723 100644 --- a/module_citeq.lua +++ b/module_citeq.lua @@ -838,7 +838,7 @@ local function _cite_q (citeq_args) end 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 not editor.last and i <= (tonumber (citeq_args['display-editors']) or tonumber (editor_count)) then if editor.qid then -- ignore anonymous if editor.qid ~= 'Q4233718' then From ed199defcb6a6cc766bc370a77b1224a7868935b Mon Sep 17 00:00:00 2001 From: Trappist the monk Date: Mon, 19 Oct 2026 13:34:43 +1300 Subject: [PATCH 5/5] should not use fixed font size --- module_citeq.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module_citeq.lua b/module_citeq.lua index 409f723..41c17d5 100644 --- a/module_citeq.lua +++ b/module_citeq.lua @@ -867,7 +867,7 @@ local function _cite_q (citeq_args) if #missing_names > 0 and not string.find(opt_cat, name_cat, 1, true) then opt_cat = opt_cat .. name_cat -- TODO: format and i18n this string - opt_cat = opt_cat .. ' {{[[Template:Cite Q|Cite Q]]}}: Missing first/last names in Wikidata for ' .. table.concat(missing_names, ', ') .. ' ([[Template:Cite Q#Error messages|help]]) ' + opt_cat = opt_cat .. ' {{[[Template:Cite Q|Cite Q]]}}: Missing first/last names in Wikidata for ' .. table.concat(missing_names, ', ') .. ' ([[Template:Cite Q#Error messages|help]]) ' end -- change edition to ordinal if it's set and numeric @@ -882,7 +882,7 @@ local function _cite_q (citeq_args) else local tpara = frame:expandTemplate{ title = 'para', args = {'ref', citeq_args.ref} } -- TODO: format and i18n this string - opt_cat = opt_cat .. ' {{[[Template:Cite Q|Cite Q]]}}: supplied ' .. tpara .. ' does not match value generated from Wikidata: ' .. citeref .. ' ([[Template:Cite Q#Error messages|help]]) ' + opt_cat = opt_cat .. ' {{[[Template:Cite Q|Cite Q]]}}: supplied ' .. tpara .. ' does not match value generated from Wikidata: ' .. citeref .. ' ([[Template:Cite Q#Error messages|help]]) ' end end