Jump to content

Module:Sandbox/PhiH/Route

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by PhiH (talk | contribs) at 07:58, 16 December 2020 (include table). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

local p = {} 
function p.route(frame)
    local route = frame.args.route
    local inv = frame.args.inv
    local list = mw.text.split(route, '\n')
    local output = ''
    
    for i, v in ipairs(list) do
    	if not (i == 1) then output = output .. '–' end
    	output = output .. '[[' .. v .. ' railway station|' .. v .. ']]'
    end
    return output
end
return p