Module:Testing: Difference between revisions

From RuneTails
NES (talk | contribs)
Replaced content with "local p = {} function p.getFilename(frame) local url = frame.args[1] or "" return mw.ustring.match(url, ".+/([^/]+)$") or url end return p"
Tag: Replaced
NES (talk | contribs)
No edit summary
Line 1: Line 1:
local p = {}
local p = {}


function p.getFilename(frame)
function p.getPath(frame)
     local url = frame.args[1] or ""
     local url = frame.args[1] or ""
     return mw.ustring.match(url, ".+/([^/]+)$") or url
     return url:gsub("^https?://[^/]+/", "")
end
end


return p
return p

Revision as of 02:05, 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 ""
    return url:gsub("^https?://[^/]+/", "")
end

return p