跳转到内容

Module:BASICPAGENAME

被永久保护的模块
来自维基导游
local i = {}

function i.BASICPAGENAME(frame)
    local basicpagename = frame:getParent().args[1] or '';
    if basicpagename == '' then
        basicpagename = mw.title.getCurrentTitle().subpageText;
    end

    basicpagename = mw.ustring.gsub(basicpagename, '%s[%((].*[%))]', '');
    basicpagename = mw.ustring.gsub(basicpagename, '.*%/', '');

    return basicpagename;
end

return i;