Module:Redirect hatnote: Difference between revisions
From the Croc Wiki, the Croc encyclopedia
Jump to navigationJump to search
Content deleted Content added
still wrong, but slightly less wrong? |
increment iArg two at a time; better but still buggy |
||
Line 13:
function p.redirect(frame)
-- Get the args table and work out the maximum arg key.
--[[
local origArgs = frame:getParent().args
local args = {}
Line 23 ⟶ 25:
if v ~= '' then
args[k] = v
end▼
--]]
local args = require('Module:Arguments').getArgs(frame)
local maxArg = 0
for k, v in pairs(args) do
if type(k) == 'number' and k > maxArg then
maxArg = k
end
end
Line 38 ⟶ 49:
-- Create the data table.
local data = {}
local iArg =
local iData = 1
while iArg < maxArg do
iArg = iArg +
local useTable = data[iData] or {}
local use
useTable.use = use▼
▲ end
▲ useTable[#useTable + 1] = page
▲ end
data[iData] = useTable
if
iData = iData + 1
end
mw.logObject(useTable)
end
|