Module:LinkUtil: Difference between revisions

From Tardis Wiki, the free Doctor Who reference
No edit summary
No edit summary
Line 8: Line 8:
end
end


function p.stripSMW(str)
function p.stripPipe(str)
if str[3] == ":" then
     local ret = str:gsub('%|.*',''):gsub('%]%]','')
    local ret = str:gsub('.*%:',''):gsub('%|.*',''):gsub('%]%]','')
     else
    local ret = str:gsub('%|.*',''):gsub('%]%]','')
    end
     return ret
     return ret
end
end


return p
return p

Revision as of 14:20, 28 December 2021

Documentation for this module may be created at Module:LinkUtil/doc

local p = {} --p stands for package

-- from https://lol.fandom.com/wiki/Module:EsportsUtil
function p.stripDab(str)
    -- don't return second values
    local ret = str:gsub('_', ' '):gsub('%s*%(.*%)','')
    return ret
end

function p.stripPipe(str)
    local ret = str:gsub('%|.*',''):gsub('%]%]','')
    return ret
end

return p