Changes
merge rellink into hatnote, use an options table to pass options to the hatnote function, and add a tracking category for errors
-- Formats an error message to be returned to wikitext.
checkType('_makeWikitextError', 1, msg, 'string')
local errorCategory = 'Hatnote templates with errors' local errorCategoryLink = errorCategory and string.format( '[[%s:%s]]', mw.site.namespaces[14].name, errorCategory ) or '' return string.format( '<strong class="error">Error: %s.</strong>%s', msg, errorCategoryLink )
end
local args = getArgs(frame)
local s = args[1]
local options = {}
if not s then
return p._makeWikitextError('no text specified')
end
options.extraclasses = args.extraclasses options.selfref = args.selfref return p._hatnote(s, options)
end
function p._hatnote(s, options)
checkType('_hatnote', 1, s, 'string')
end
end
return string.format( '<div class="rellink%s">%s</div>', extraclasses table.concat(classes, ' '), s )
end
return p