Module:Br separated entries
Εμφάνιση

local p = {}
local function _main( args )
local t = {}
for k, v in pairs( args ) do
if type( k ) == 'number' and k >= 1 and math.floor( k ) == k then
table.insert( t, v )
end
end
return table.concat( t, '<br />' )
end
function p.main( frame )
local origArgs
if frame == mw.getCurrentFrame() then
origArgs = frame:getParent().args
for k, v in pairs( frame.args ) do
origArgs = frame.args
break
end
else
origArgs = frame
end
-- Remove whitespace-only arguments, but don't trim any whitespace
-- yet. The old {{bar separated entries}} templage needs whitespace
-- to be preserved.
local args = {}
for k, v in pairs( origArgs ) do
if mw.ustring.match( v, '%S' ) then
args[ k ] = v
end
end
return _main( args )
end
return p