Module:Sandbox/PhiH/Route

local p = {} function p.route(frame) local route = frame.args.route local inv = frame.args.inv local station = frame.args.station local listall = frame.args.listall local ilist = mw.text.split(route, '\n') local output = '' local list = {} if not (int == '') then for i, v in ipairs(ilist) do   		list[#ilist - i + 1] = v    	end else list = ilist end for i, v in ipairs(list) do   	local entry = mw.text.split(v, '\\') if (entry[1] == station) then output = output .. '–\'\'\'' .. v .. '\'\'\   	elseif (#entry == 1 or entry[2] == 'M') and not (listall == ) then if not (i == 1) then output = output .. ' – ' end output = output .. stnlnk(entry[1], entry[3]) end end return output end

function p.stnlnk(frame) local station = frame.args[1] local link = frame.args[2] return stnlnk(station, link) end

function stnlnk(station, link) if link == nil then link = station .. ' railway station' end return  .. station ..  end return p