跳转到内容

模組:Taxobox

维基百科,自由的百科全书

这是本页的一个历史版本,由乌拉跨氪留言 | 贡献2013年8月17日 (六) 13:59编辑。这可能和当前版本存在着巨大的差异。

local p = {}

function italicize( arg )
    return '\'\'' .. arg .. '\'\''
end

function strip( arg )
    return string.gsub( arg, '[\' ]*(.*)[\' ]*', '%1' )
end

function p.species( frame )
    local species = frame.args[1]
    local species_zh = frame.args[2]
    if species_zh == nil or species_zh == '' then
        return italicize( strip( species ) )
    else
        return strip( species_zh ) .. ' ' .. italicize( strip( species ) )
    end
end

return p