Module:Cite Q: Difference between revisions

Content deleted Content added
accept any and all cs1|2 parameters in the template call;
Commenting out problematic code that is causing links to appear in WhatLinksHere
Line 89:
else
-- no sitelink, so check first for a redirect with that label
-- this code works, but causes the article to appear in WhatLinksHere for the possible destination, so remove
local artitle = mw.title.new(label, 0)
if-- local artitle.id >= 0mw.title.new(label, then0)
-- if artitle.isRedirectid > 0 then
-- if artitle.isRedirect then
-- no sitelink,
-- but there's a redirect with the same title as the label;
-- so store the link to that
-- out[#out + 1] = label
-- link[#out] = label
-- else
-- no sitelink and not a redirect but an article exists with the same title as the label
-- that's probably a dab page, so output the plain label
-- out[#out + 1] = label
-- end
--else
-- no article or redirect with the same title as the label
if wdl then
-- show that there's a Wikidata entry available
out[#out + 1] = "[[:d:Q" .. v.mainsnak.datavalue.value["numeric-id"] .. "|" .. label .. "]]&nbsp;<span title='" .. i18n["errors"]["local-article-not-found"] .. "'>[[File:Wikidata-logo.svg|16px|alt=|link=]]</span>"
else
-- no articlewikidata orlinks redirectwanted, withso thejust samegive titlethe as theplain label
ifout[#out wdl+ then1] = label
-- show that there's a Wikidata entry available
out[#out + 1] = "[[:d:Q" .. v.mainsnak.datavalue.value["numeric-id"] .. "|" .. label .. "]]&nbsp;<span title='" .. i18n["errors"]["local-article-not-found"] .. "'>[[File:Wikidata-logo.svg|16px|alt=|link=]]</span>"
else
-- no wikidata links wanted, so just give the plain label
out[#out + 1] = label
end
end
-- end
end
end