Module:Cite Q/sandbox: Difference between revisions

Content deleted Content added
slink = slink:gsub("%s%(.+%)$", ""):gsub(",.+$", "")
fix disambiguations
Line 224:
citeq_args.url = getValue( {"P856", ps = 1, qid = citeq_args.qid, maxvals=0, citeq_args.url } ) -- try official website
citeq_args.url = getValue( {"P2699", ps = 1, qid = citeq_args.qid, maxvals=0, citeq_args.url } ) -- try url
citeq_args.title local slink = mw.wikibase.getSitelink(citeq_args.qid)
local label = mw.wikibase.getLabel(citeq_args.qid)
if not citeq_args.title then
if slink then
citeq_args.title = mw.wikibase.getSitelink(citeq_args.qid)
if citeq_args.title then
citeq_args.url = nil
if slink:lower() == label:lower() then
citeq_args.title = '[[' .. citeq_args.title .. ']]'
if citeq_args.title then= '[[' .. slink .. ']]'
else
-- citeq_args.title = '[[' .. slink =.. '|' .. slink:gsub("%s%(.+%)$", ""):gsub(",.+$", "") .. ']]'
end
else
citeq_args.title = mw.wikibase.getLabel(citeq_args.qid)label
end
end
-- slink = slink:gsub("%s%(.+%)$", ""):gsub(",.+$", "")
 
for k, v in pairs(citeq_args) do