Module:Cite Q: Difference between revisions

Content deleted Content added
sync from sandbox (adds Wikisource link, if available - see talk)
Tag: Reverted
Undid revision 1022430615 by Pigsonthewing (talk) bug found
Tags: Undo Reverted
Line 512:
local slink_flag = false
local wrap_title = ''
local wslink = false
if not slink then
-- See if we have wikisource
if not citeq_args.url then
local wikisource_sitelink = mw.wikibase.getSitelink(qid, "enwikisource") or nil
if wikisource_sitelink then
slink = ':s:'..wikisource_sitelink
wslink = true
end
end
end
if citeq_args.title then
if slink then
Line 531 ⟶ 520:
end
else
if slink and not wslink then
if slink:lower() == title_display:lower() then
citeq_args.title = '[[' .. slink .. ']]'
Line 538 ⟶ 527:
slink_flag = true
end
elseif wslink then
wrap_title = wrap_nowiki(title_display)
slink_flag = true
else
citeq_args.title = wrap_nowiki(title_display)
Line 546 ⟶ 532:
end
if slink_flag then
if slink == wrap_title and not wslink then -- direct link
citeq_args.title = '[[' .. slink .. ']]'
else -- piped link