0
edits
Arjunaraoc (చర్చ | రచనలు) చి (en:Module:UserLinks/shared నుండి ఒక కూర్పు: తెలుగులోకి) |
(set up a local blacklist system so that we don't categorise sandboxes or test case pages) |
||
end
error(message, level)
end
local localBlacklist = {
'/[sS]andbox$', -- Don't categorise sandboxes
'/[tT]est ?cases$', -- Don't categorise test case pages
}
local function currentTitleMatchesLocalBlacklist()
-- Return true if the current title matches any of the patterns in the
-- local blacklist table. Otherwise return false.
local title = mw.title.getCurrentTitle().prefixedText
for i, pattern in ipairs(localBlacklist) do
if title:find(pattern) then
return true
end
end
return false
end
-- Categorise all namespaces, but not blacklisted pages.
category = mCategoryHandler.main{all = category}
end
if category and currentTitleMatchesLocalBlacklist() then
category = nil
end
end
|
edits