Modul:Hatnote: Unterschied zwischen den Versionen
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) |
||
Zeile 11: | Zeile 11: | ||
local mArguments -- lazily initialise [[Module:Arguments]] | local mArguments -- lazily initialise [[Module:Arguments]] | ||
local yesno -- lazily initialise [[Module:Yesno]] | local yesno -- lazily initialise [[Module:Yesno]] | ||
local mCategoryHandler -- lazily initialise [[Module:Category handler]] | |||
local p = {} | local p = {} | ||
Zeile 80: | Zeile 81: | ||
checkType('makeWikitextError', 1, msg, 'string') | checkType('makeWikitextError', 1, msg, 'string') | ||
yesno = require('Module:Yesno') | yesno = require('Module:Yesno') | ||
mCategoryHandler = require('Module:Category handler') | |||
local errorCategory = 'Hatnote templates with errors' | local errorCategory = 'Hatnote templates with errors' | ||
local | local errorCategoryLink = string.format( | ||
'[[%s:%s]]', | |||
mw.site.namespaces[14].name, | |||
errorCategory | |||
) | |||
-- Feed the category link through [[Module:Category handler]] so we can | |||
-- use its blacklist. | |||
errorCategoryLink = mCategoryHandler.main{ | |||
all = errorCategoryLink, | |||
nocat = demo | |||
} | |||
errorCategoryLink = errorCategoryLink or '' | |||
return string.format( | return string.format( | ||
'<strong class="error">Error: %s.</strong>%s', | '<strong class="error">Error: %s.</strong>%s', |