Module:Backwards copy: Difference between revisions

Content deleted Content added
table.insert
finish list display
Line 44:
local id = args["id"] or args["revid"]
if id ~= nil then
text = string.format("Revisions succeeding [[Special:Diff/%s|this version]] of this", id)
else
text = "This"
Line 51:
local citations = {}
local i = 1
while (
while args[tostring(i)] or args["articlename" .. i] or args["title" .. i] or (i == 1 and (args["articlename"] or args["title"])) do
args[tostring(i)] or
while args[tostring (i)] or args["articlename" .. i] or args["title" .. i] or (i == 1 and (args["articlename"])) or args["title"])) do
(args["title" .. i] or (i == 1 and args["title"]))
) do
if args[tostring(i)] then
table.insert(citations, args[tostring(i)])
else
local date = (args["date" .. i] or (i == 1 and args["date"])) or
Line 66 ⟶ 70:
ref = "none",
author = args["author" .. i] or (i == 1 and args["author"]),
authorlistauthors = args["authorlist" .. i] or (i == 1 and args["authorlist"]),
["display-authors"] = args["display-authors" .. i] or (i == 1 and args["display-authors"]),
date = date,
Line 85 ⟶ 89:
text
)
local citationCount = #citations
if citations.getn() > 0 then
if citationCount == 0 then
return showError(
"No citations were provided. Provide at least one citation using <code>title</code>.",
demoCheck(args)
)
elseif citations.getn()citationCount > 1 then
text = string.format("%ss:", text)
else