Modul:Category handler/shared: Unterschied zwischen den Versionen

Aus skandinavien-wiki.net
(allow specifying a custom blacklist)
(make this output either true or false, and switch indentation to tabs)
Zeile 3: Zeile 3:


local function matchesBlacklist(page, blacklist)
local function matchesBlacklist(page, blacklist)
    if type(page) ~= 'string' then
for i, pattern in ipairs(blacklist) do
    return nil
local match = mw.ustring.match(page, pattern)
    end
if match then
    for i, pattern in ipairs(blacklist) do
return true
        local match = mw.ustring.match(page, pattern)
end
        if match then
end
            return match
return false
        end
    end
end
end



Version vom 7. Juli 2014, 14:13 Uhr

Die Dokumentation für dieses Modul kann unter Modul:Category handler/shared/doc erstellt werden

-- This module contains shared functions used by [[Module:Category handler]]
-- and its submodules.

local function matchesBlacklist(page, blacklist)
	for i, pattern in ipairs(blacklist) do
		local match = mw.ustring.match(page, pattern)
		if match then
			return true
		end
	end
	return false
end

return {
	matchesBlacklist = matchesBlacklist
}