Jump to content

Module:Demo

Permanently protected module
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Codehydro (talk | contribs) at 17:57, 31 December 2014. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

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('<pre%s>%s</pre>%s%s', frame.args.style and string.format(" style='%s'", frame.args.style) or '', code, br, template)
end

return p