FANDOM


-- <pre>
-- {{#invoke:syntaxHighlight|hl|lua|var|test}}
 
p = {};
local languages = {
    lua = {
        var = '<span style="color:#339900"><i>%s</i></span>',
        func = '<span style="color:#EB1D51">%s</span>',
        doc = '<span style="color:#808080"><i>%s</i></span>',
        com = '<span style="color:#C53DFF">%s</span>',
        type = '<span style="color:#2F7FCC"><i>%s</i></span>'
    }
}
 
function p.style(frame)
    if languages[frame.args[1]] ~= nil then
        if languages[frame.args[1]][frame.args[2]] ~= nil then
            return string.format(languages[frame.args[1]][frame.args[2]], frame.args[3])
        end
    end
end
 
return p