Module:Demo: Difference between revisions

From Zoophilia Wiki
Jump to navigationJump to search
meta>Codehydro
No edit summary
meta>Codehydro
No edit summary
Line 3: Line 3:
function p.main(frame)
function p.main(frame)
args = require('Module:Arguments').getArgs(frame, {
args = require('Module:Arguments').getArgs(frame, {
trim = false
trim = false,
removeBlanks = false
})
})
local br = ''
local br = ''
Line 9: Line 10:
br = br .. '<br>'
br = br .. '<br>'
end
end
return string.format('<pre%s><nowiki>%s<nowiki></pre>%s%s', args.style and string.format(" style='%s'", args.style) or '', args[1] or '', br, args[1] or '')
return string.format('<pre%s>%s</pre>%s%s', args.style and string.format(" style='%s'", args.style) or '', args[1] or '', br, args[1] or '')
end
end


return p
return p

Revision as of 15:39, 31 December 2014

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

local p = {}

function p.main(frame)
	args = require('Module:Arguments').getArgs(frame, {
		trim = false,
		removeBlanks = false
	})
	local br = ''
	for k = 1, (args.br or 1) do
		br = br .. '<br>'
	end
	return string.format('<pre%s>%s</pre>%s%s', args.style and string.format(" style='%s'", args.style) or '', args[1] or '', br, args[1] or '')
end

return p