Module:Flag

可在Module:Flag/doc创建此模块的帮助文档

local p = {}

function p.flag(country, text)
    local f = string.format("[[File:%s.png|24px|border|alt=Flag of %s|link=%s]]", country, country, country)
    local t
    if type(text) == "number" then
        t = ""
    elseif text ~= nil then
        t = string.format(" [[%s|%s]]", country, text)
    else
        t = string.format(" [[%s]]", country)
    end
    return f .. t
end

return p