モジュール:Code/sandbox
ナビゲーションに移動
検索に移動
local p = {}
function p.main( frame )
local args = require( 'Module:Arguments' ).getArgs( frame, { wrappers = 'Template:Code', removeBlanks = false } )
local code = args[1] or '';
local text = args[2] or '';
if code == '' then
return frame:extensionTag{ name = 'code', content = text }
end
return frame:extensionTag{ name = 'syntaxhighlight', content = text, args = { lang = code, line_start = '1' } }
end
return p