Module:Cite Q: Difference between revisions

Content deleted Content added
Syncing; Version: 2021-02-21
sync from sandbox (adds Wikisource link, if available - see talk)
Tag: 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 520 ⟶ 531:
end
else
if slink and not wslink then
if slink:lower() == title_display:lower() then
citeq_args.title = '[[' .. slink .. ']]'
Line 527 ⟶ 538:
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 532 ⟶ 546:
end
if slink_flag then
if slink == wrap_title and not wslink then -- direct link
citeq_args.title = '[[' .. slink .. ']]'
else -- piped link