local shield, missingShields = p.shield(route)
insert(shields, shield)
if missingShields[1] then
insert(allMissingShields, concat(missingShields, ' / '))
end
end
local prefix = prefix(route.to, num)
if prefix ~= '' then insert(links, prefix) end
insert(links, routeText(route, args.jctname, ))
typeErr = typeErr or route.typeerror or false
toErr = toErr or route.toerror or false
end
local graphics = concat(shields) .. extra(args) .. ' '
local linkText = concat(links)
local cities = ''
if args.city1 or args.location1 then
local citiesPrefix
if args.citiesprefix then
citiesPrefix = args.citiesprefix ~= * and format(" %s ", args.citiesprefix) or *
else
citiesPrefix = '&nbsp;'
end
local cityModule = require(cityModuleName)
cities = citiesPrefix .. cityModule.city(args)
end  
local errorMsg = {}
-- Errors must be reported by the level of severity, most severe first.
if typeErr then
-- Report invalid type errors.
addErrorMsg("§", 'error: Invalid route type', errorMsg)
end
if #allMissingShields > 0 then
-- Report missing shield error.
-- shieldExists would have populated missingShields if shields are missing.
addErrorMsg("¶", 'error: Missing route marker graphics: ' .. concat(allMissingShields, ' / '), errorMsg)
end
if toErr then
-- Report invalid to errors.
addErrorMsg("&", 'error: Invalid "to" argument', errorMsg)
end
if args.road then
-- Report deprecated "road" warning.
addErrorMsg("∆", 'warning: "road" parameter is deprecated', errorMsg)
end
if args.rdt then
-- Report deprecated "rdt" warning.
addErrorMsg("£", 'warning: "rdt" parameter is deprecated', errorMsg)
end
if #errorMsg > 0 then
local page = mw.title.getCurrentTitle.prefixedText -- Get transcluding page's title
-- Add a category for the first, most severe error.
insert(errorMsg, format('', errorMsg.code, page))
errorMsg = concat(errorMsg)
else
errorMsg = ''
end  
return graphics .. linkText .. cities .. errorMsg
end  
function p.jct
-- Import module function to work with passed arguments
local getArgs = require('Module:Arguments').getArgs
local args = getArgs(, {removeBlanks = false})
return p._jct(args, )
end  
function p._roadlink(args, )
local routes = parseArgs(args)
local links = {}
local typeErr = false
local toErr = false
= or mw.getCurrentFrame
for num,route in ipairs(routes) do
local prefix = prefix(route.to, num)
if prefix ~= '' then insert(links, prefix) end
insert(links, routeText(route, args.jctname, ))
typeErr = typeErr or route.typeerror or false
toErr = toErr or route.toerror or false
end
local linkText = concat(links)
local cities = ''
if args.city1 or args.location1 then
local citiesPrefix
if args.citiesprefix then
citiesPrefix = args.citiesprefix ~= * and format(" %s ", args.citiesprefix) or *
else
citiesPrefix = '&nbsp;'
end
local cityModule = require(cityModuleName)
cities = citiesPrefix .. cityModule.city(args)
end  
local errorMsg = {}
-- Errors must be reported by the level of severity, most severe first.
if typeErr then
-- Report invalid type errors.
addErrorMsg("2", 'error: Invalid route type', errorMsg)
end
if toErr then
-- Report invalid to errors.
addErrorMsg("3", 'error: Invalid "to" argument', errorMsg)
end
if args.road then
-- Report deprecated "road" warning.
addErrorMsg("W", 'warning: "road" parameter is deprecated', errorMsg)
end
if #errorMsg > 0 then
local page = mw.title.getCurrentTitle.prefixedText -- Get transcluding page's title
-- Add a category for the first, most severe error.
insert(errorMsg, format('', errorMsg.code, page))
errorMsg = concat(errorMsg)
else
errorMsg = ''
end  
return linkText .. cities
end  
function p.roadlink
-- Import module function to work with passed arguments
local getArgs = require('Module:Arguments').getArgs
local args = getArgs(, {removeBlanks = true})
return p._roadlink(args, )
end  
return p