Module:Hatnote: Difference between revisions

use the blacklist from Module:Category handler in the makeWikitextError function
(fix function name)
(use the blacklist from Module:Category handler in the makeWikitextError function)
Line 11:
local mArguments -- lazily initialise [[Module:Arguments]]
local yesno -- lazily initialise [[Module:Yesno]]
local mCategoryHandler -- lazily initialise [[Module:Category handler]]
 
local p = {}
Line 80 ⟶ 81:
checkType('makeWikitextError', 1, msg, 'string')
yesno = require('Module:Yesno')
mCategoryHandler = require('Module:Category handler')
local errorCategory = 'Hatnote templates with errors'
local errorCategoryLink = string.format(
'[[%s:%s]]',
if yesno(demo) then
mw.site.namespaces[14].name,
errorCategoryLink = ''
errorCategory
else
)
errorCategoryLink = string.format(
-- Feed the category link through [[Module:Category handler]] so we can
'[[%s:%s]]',
-- use its blacklist.
mw.site.namespaces[14].name,
errorCategoryLink = stringmCategoryHandler.format(main{
errorCategory
all = errorCategoryLink,
)
nocat = demo
end
}
errorCategoryLink = errorCategoryLink or ''
return string.format(
'<strong class="error">Error: %s.</strong>%s',
Anonymous user