Content deleted Content added
Trialpears (talk | contribs) Apparently Copied multi has had logic bugs for a decade |
Trialpears (talk | contribs) Handle missing to_diff better (feature not in original template but obviously an improvement tell me if it's a problem) |
||
Line 7:
local from_oldid = args["from_oldid"] or args["from_oldid1"] or ""
local from = args["from"] or args["from1"] or ""
local to_diff = args["to_diff"] or args["to_diff1"] or ""▼
local diff = args["diff"] or args["diff1"] or ""▼
local to_oldid = args["to_oldid"] or args["to_oldid1"] or ""▼
local to = args["to"] or args["to1"] or ""
local date = args["date"] or args["date1"] or ""
Line 29 ⟶ 26:
text = string.format("%s [[%s]]",text,to)
end
if (diff) then
text = string.format("%s with [%s this edit]",text,diff)
elseif
local to_diff2 = args["to_diff"] or args["to_diff1"] or "prev"
text = string.format("%s with [%s this edit]",text,tostring(mw.uri.fullUrl(to, {diff=to_diff, oldid = to_oldid} )))▼
▲ text = string.format("%s with [%s this edit]",text,tostring(mw.uri.fullUrl(to, {diff=to_diff or "prev", oldid = to_oldid or ""} )))
end
if not (date == "") then
Line 70 ⟶ 72:
local diff = args["diff" .. i]
local to_oldid = args["to_oldid" .. i]▼
local to_diff = args["to_diff".. i] or ""▼
if (diff) then
text = string.format("%s ([%s diff])",text,diff)
elseif (args["to_oldid" .. i] or args["to_diff".. i]) then
▲ local to_diff = args["to_diff".. i] or "prev"
text = string.format("%s ([%s diff])",text,tostring(mw.uri.fullUrl(to, {diff=to_diff or "", oldid = to_oldid or ""} )))▼
▲ text = string.format("%s ([%s diff])",text,tostring(mw.uri.fullUrl(to, {diff=to_diff
end
local date = args["date" .. i]
Line 89 ⟶ 91:
end
end
if
text = string.format("%s[[Category:Wikipedia pages using copied template without oldid]]",text)
end
|