More actions
Documentation for this module may be created at Module:AnimateText/doc
local p = {}
function p.animate( f )
local args = f
if f == mw.getCurrentFrame() then
args = f:getParent().args
end
local text = {}
for row in mw.text.gsplit( args[1], '%s*,,%s*' ) do
if row == '' then
table.insert( text, '<span><br></span>' )
else
table.insert( text, '<span>' .. row .. '</span>' )
end
end
text[1] = text[1]:gsub( '^<span>', '<span class="animated-active">' )
return '<span class="animated">' .. table.concat( text ) .. '</span>'
end
return p