Module:URLEncode: Difference between revisions
From The Joe Frank Wiki
s/r in function |
a |
||
Line 2: | Line 2: | ||
function p.encode(frame) | function p.encode(frame) | ||
-- Retrieve the current page title directly | |||
-- | local title = mw.title.getCurrentTitle().text | ||
-- Perform URL encoding | -- Perform URL encoding | ||
return mw.uri.encode( | return mw.uri.encode(title, 'PATH') | ||
end | end | ||
return p | return p |
Latest revision as of 08:08, 27 October 2024
Documentation for this module may be created at Module:URLEncode/doc
local p = {}
function p.encode(frame)
-- Retrieve the current page title directly
local title = mw.title.getCurrentTitle().text
-- Perform URL encoding
return mw.uri.encode(title, 'PATH')
end
return p