Difference between revisions of "Module:Code"

From Foundation - Wiki
Jump to navigation Jump to search
(Created page with "local com = require('Module:Common') local p = {} function p.code(frame) result = mw.html.create('span') result:wikitext(frame.args[1]) result.addClass('mw-highlight mw-highlight-lang-' .. frame.args['lang']) return result end")
 
 
Line 3: Line 3:


function p.code(frame)
function p.code(frame)
result = mw.html.create('span')
result = mw.html.create('code')
result:wikitext(frame.args[1])
result:wikitext(frame.args[1])
result.addClass('mw-highlight mw-highlight-lang-' .. frame.args['lang'])
result.addClass('mw-highlight mw-highlight-lang-' .. frame.args['lang'])
return result
return result
end
end
return p

Latest revision as of 07:52, 26 March 2022

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

local com = require('Module:Common')
local p = {}

function p.code(frame)
	result = mw.html.create('code')
	result:wikitext(frame.args[1])
	result.addClass('mw-highlight mw-highlight-lang-' .. frame.args['lang'])
	return result
end

return p