Module:PrettyList

From Linux Web Expert

Revision as of 20:03, 2 August 2016 by imported>Legoktm (use commas)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

{{#invoke:PrettyList|prettify|mediawiki/core,mediawiki/extensions/FooBar}} produces:

mediawiki/core, mediawiki/extensions/FooBar


local p = {}

p.prettify = function( frame )
	local ugly = frame.args[1]
	local splitted = mw.text.split( ugly, ',', true )
	return '<code>' .. table.concat( splitted, "</code>, <code>" ) .. "</code>"
end

return p