Module:Delink: Difference between revisions

From the Croc Wiki, the Croc encyclopedia
Jump to navigationJump to search
Replace hardcoded namespaces with namespace lookups
(better decoding support)
(Replace hardcoded namespaces with namespace lookups)
Line 57:
-- Check for categories, interwikis, and files.
local colonprefix = mw.ustring.match(result, "%[%[(.-):.*%]%]") or "" -- Get the text before the first colon.
local ns = mw.site.namespaces[colonprefix] -- see if this is a known namespace
if mw.language.isKnownLanguageTag(colonprefix)
or ( ns and ( ns.canonicalName == "File" or ns.canonicalName == "Category" ) ) then
or mw.ustring.match(colonprefix, "^[Cc]ategory$")
or mw.ustring.match(colonprefix, "^[Ff]ile$")
or mw.ustring.match(colonprefix, "^[Ii]mage$") then
return ""
end
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.

Navigation menu