Module:Demo

From MINR.ORG WIKI
Revision as of 19:55, 31 December 2014 by Codehydro (talk) (it works!)

Documentation for this module may be created at Module:Demo/doc

local p = {}

function p.main(frame)
	frame = frame:getParent() or frame
	local code = mw.text.unstripNoWiki(frame.args[1])
	local template = frame:preprocess(mw.text.unstripNoWiki(frame.args[1]))
	local br = ''
	for k = 1, (frame.args.br or 1) do
		br = br .. '<br>'
	end
	return string.format('<div><pre%s>%s</pre>%s%s</div>', frame.args.style and string.format(" style='display:block;%s'", frame.args.style) or '', code, br, template)
end

return p