Module:Infobox: रिवीजन सभ के बीचा में अंतर

Content deleted Content added
tweak comment at the start
hack to parse the parameters in the 'correct' order
लाइन 247:
return tostring(root)
end
 
-- This function parses the parameters with the given prefixes, in order, in batches of 20.
local function touchParameters(prefixTable, origArgs)
if type(prefixTable) ~= 'table' or type(origArgs) ~= 'table' then
error("Invalid input to the touchParameters function detected. Both parameters must be tables.", 2)
end
local temp
local argumentCounter = 1
local moreArgumentsExist = true
for j,v in ipairs(prefixTable) do
if not type(v) == "string" then
error("Non-string value detected in the prefix table in the touchParameters function.", 2)
end
temp = origArgs[v]
end
while moreArgumentsExist == true do
moreArgumentsExist = false
for i = argumentCounter, argumentCounter + 19 do
for j,v in ipairs(prefixTable) do
temp = origArgs[v .. tostring(i)]
if temp then
moreArgumentsExist = true
end
end
end
argumentCounter = argumentCounter + 20
end
end
Line 258 ⟶ 286:
origArgs = frame
end
-- Parse the data parameters in the same order that the old {{infobox}} did, so that
-- references etc. will display in the expected places.
local temp
temp = origArgs.title
temp = origArgs.above
touchParameters({'subheader'}, origArgs)
touchParameters({'image', 'caption'}, origArgs)
touchParameters({'header', 'label', 'data'}, origArgs)
temp = origArgs.below
-- ParserFunctions considers whitespace to be false, so to preserve the previous
"https://bh.wikipedia.org/wiki/Module:Infobox" से लिहल गइल