Module:URLEncode

From The Joe Frank Wiki
Revision as of 07:06, 27 October 2024 by Ramon (talk | contribs) (s/r in function)

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

local p = {}

function p.encode(frame)
    local str = frame.args[1] or ''
    -- Decode any HTML entities back to their original characters
    str = mw.text.decode(str)
    -- Perform URL encoding
    return mw.uri.encode(str, 'PATH')
end

return p