8,756
edits
mNo edit summary |
mNo edit summary |
||
Line 58: | Line 58: | ||
-- This function on Leaguepedia is part of Module:ArgsUtil but is copied here to avoid dependencies | -- This function on Leaguepedia is part of Module:ArgsUtil but is copied here to avoid dependencies | ||
function h.merge() | function h.merge(mergeParent) | ||
mergeParent = mergeParent or true | |||
local f = mw.getCurrentFrame() | local f = mw.getCurrentFrame() | ||
local origArgs = f.args | local origArgs = f.args | ||
local args = {} | local args = {} | ||
if mergeParent then | |||
for k, v in pairs( | local parentArgs = f:getParent().args | ||
for k, v in pairs(parentArgs) do | |||
v = mw.text.trim(tostring(v)) | v = mw.text.trim(tostring(v)) | ||
if v ~= '' then | if v ~= '' then | ||
args[k] = v | args[k] = v | ||
end | end | ||
end | |||
end | end | ||
for k, v in pairs(origArgs) do | |||
for k, v in pairs( | |||
v = mw.text.trim(v) | v = mw.text.trim(v) | ||
if v ~= '' then | if v ~= '' then | ||
Line 154: | Line 155: | ||
function p.compound(frame) | function p.compound(frame) | ||
local args = h.merge() | local args = h.merge(false) | ||
local splitargs = {} | local splitargs = {} | ||
for a, b in ipairs(args) do | for a, b in ipairs(args) do |