Difference between revisions of "Module:Location"
Jump to navigation
Jump to search
(Created page with "-- <nowiki> local p = {} local function unlink( v ) return mw.text.trim( v:match( '%[%[:?(.-)[|%]]' ) or v ) end function p.location(frame) local lines = mw.text.spl...") |
(No difference)
|
Latest revision as of 00:32, 16 December 2018
Documentation for this module may be created at Module:Location/doc
-- <nowiki>
local p = {}
local function unlink( v )
return mw.text.trim( v:match( '%[%[:?(.-)[|%]]' ) or v )
end
function p.location(frame)
local lines = mw.text.split(frame.args[1], '*')
local result = ''
for k, v in ipairs(lines) do
v = mw.text.trim(v)
if v ~= '' then
result = result .. '[[Category:Location: ' .. unlink( v ) .. ']]'
end
end
return result
end
return p
-- </nowiki>