Module:Testing: Difference between revisions

From RuneTails
NES (talk | contribs)
No edit summary
NES (talk | contribs)
No edit summary
Line 3: Line 3:
function p.getPath(frame)
function p.getPath(frame)
     local url = frame.args[1] or ""
     local url = frame.args[1] or ""
     return url:gsub("^https?://[^/]+/", "")
     local path = url:match("https?://[^/]+/(.*)")
    return path or ""
end
end


return p
return p

Revision as of 02:06, 13 February 2025

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

local p = {}

function p.getPath(frame)
    local url = frame.args[1] or ""
    local path = url:match("https?://[^/]+/(.*)") 
    return path or ""
end

return p