Module:Quote

--[[ > module:quote

> currently testing > not to be used within templates

> author: sqm ]]

local p = {}

function p.quote(frame) local speaker = '' local text = mw.html.create('table') local source = '' if frame.args[1] and frame.args[1] ~= '' then speaker = mw.html.create('table') speaker :attr('class', 'speaker') :tag('td') :wikitext( .. frame.args[1] .. ) :done :allDone end text :attr('class', 'text') :tag('td') :wikitext(frame.args[2]) :done :allDone if frame.args[3] and frame.args[3] ~= '' then source = mw.html.create('div') source :attr('class', 'source') :wikitext('&mdash;') :tag('cite') :wikitext(frame.args[3]) :done :allDone end local div = mw.html.create('div') div :attr('class', 'quote') :css('margin', '0 5px 5px 0') if speaker ~= '' then div :node(speaker) end div :node(text) if source ~= '' then div :node(source) end return tostring(div) end

return p