View source for Module:Suppress categories
Jump to navigation
Jump to search
You do not have permission to edit this page, for the following reason:
You can view and copy the source of this page.
-- This is a simple module to strip categories from wikitext. It does
-- not support nested links or magic words like __TOC__, etc. Even so,
-- it should still handle most categories.
local p = {}
-- Detects if a category link is valid or not. If it is valid,
-- the function returns the blank string. If not, the input
-- is returned with no changes.
local function processCategory( all, submatch )
local beforePipe = mw.ustring.match( submatch, '^(.-)[%s_]*|[%s_]*.-$' )
beforePipe = beforePipe or submatch
if mw.ustring.match( beforePipe, '[%[%]<>{}%c\n]' ) then
return all
else
return ''
end
end
-- Preprocess the content if we aren't being called from #invoke,
000
1:0
Templates used on this page:
- Template:Module other (view source)
- Template:Module rating (view source)
- Template:Ombox (view source)
- Template:Pre (view source)
- Template:Pre/styles.css (view source)
- Module:Arguments (view source)
- Module:Effective protection level (view source)
- Module:Message box (view source)
- Module:Message box/configuration (view source)
- Module:No globals (view source)
- Module:Suppress categories (view source)
- Module:Suppress categories/doc (view source)
- Module:Yesno (view source)
Return to Module:Suppress categories.