Module:Sandbox/Frietjes: Difference between revisions

Content deleted Content added
No edit summary
No edit summary
Line 8:
end
 
function p.boxlists(frame)
local images = '\n' .. (frame.args[1] or '') .. '\n'
mw.ustring.gsub('([\r\n])%*([^\r\n]*)', '%1<ul><li>%2</li></ul>')
local caption = frame.args[2]
mw.ustring.gsub('([\r\n])#([^\r\n]*)', '%1<ol><li>%2</li></ol>')
local isleft = frame.args['left']
mw.ustring.gsub('</ol>%s*([\r\n]*)<ol>', '%1')
local iscenter = frame.args['center']
mw.ustring.gsub('</ul>%s*([\r\n]*)<ul>', '%1')
local upright = frame.args['upright'] or '1'
return s
if (caption or '') ~= '' then
local targs = {}
if isleft then
targs['bodystyle'] = 'float:left;clear:left;margin:0.5em 1em 0.5em 0em'
elseif iscenter then
targs['bodystyle'] = 'float:none;clear:both;margin:0.5em auto'
end
targs['image'] = '[[File:' .. image .. '|upright=' .. upright .. '|frameless]]'
targs['caption'] = caption
return require('Module:Infobox').infobox(targs)
end
return '[[File:' .. image .. '|thumb]]'
end