跳转到内容

模組:Taxobox

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

这是Module:Taxobox当前版本,由Fantasticfears留言 | 贡献编辑于2013年8月17日 (六) 14:42。这个网址是本页该版本的固定链接。

(差异) ←上一修订 | 最后版本 (差异) | 下一修订→ (差异)
local p = {}

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

function strip(arg)
    return (arg:gsub('[\'%s]*(.-)[\'%s]*$', '%1'))
end

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

return p