Module:Realpath: Difference between revisions
From CHIPPS
More actions
Created page with "return {realpath = function(frame) return mw.title.new(frame.args[1]).redirectTarget or frame.args[1] end}" |
No edit summary |
||
| Line 1: | Line 1: | ||
return {realpath = function(frame) | function realpath(page) | ||
return | target = mw.title.new(page).redirectTarget | ||
end} | if target | ||
then | |||
return target.prefixedText | |||
else | |||
return page | |||
end | |||
end | |||
return { | |||
realpath = function(frame) | |||
return realpath(frame.args[1]) | |||
end, | |||
realpath_list = function(frame) | |||
consist = frame.args[1] | |||
realpathed_consist = string.gsub(consist, "[^ ;][^;]+", realpath) | |||
return realpathed_consist | |||
end | |||
} | |||
Latest revision as of 10:49, 19 September 2026
Documentation for this module may be created at Module:Realpath/doc
function realpath(page)
target = mw.title.new(page).redirectTarget
if target
then
return target.prefixedText
else
return page
end
end
return {
realpath = function(frame)
return realpath(frame.args[1])
end,
realpath_list = function(frame)
consist = frame.args[1]
realpathed_consist = string.gsub(consist, "[^ ;][^;]+", realpath)
return realpathed_consist
end
}