diff --git a/module_citeq.lua b/module_citeq.lua index 4d1a58e..2c97880 100644 --- a/module_citeq.lua +++ b/module_citeq.lua @@ -569,6 +569,14 @@ local function _cite_q (citeq_args) citeq_args.wdl = nil citeq_args.template = nil + -- QID as normal form; emit error if not ^Q%d+$ (e.g. a Wikidata URL) + local qid_form = mw.ustring.match(mw.text.trim(qid), "^Q%d+$") or nil + if qid_form then + qid = qid_form + else + cq_errors = cq_errors .. ' {{[[Template:Cite Q|Cite Q]]}}: QID parameter must be supplied as "Q" followed by digits, e.g. Q12345 ([[Template:Cite Q#Error messages|help]]) ' + end + -- if title supplied, flag to not read html title local titleforced = (citeq_args.title ~= nil)