查看“模块:Suppress categories”的源代码

来自决策链云智库

因为以下原因,您没有权限编辑本页:

您请求的操作仅限属于该用户组的用户执行:用户


您可以查看和复制此页面的源代码。

-- 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,
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
000
1:0
调试控制台
* 此模块的返回的值存于控制台变量“p”中,包括没有保存的变更。 * 在一行的前面加上“=”可以将其作为表达式来计算或使用print()显示。显示表格请使用mw.logObject()。 * 在模块代码中使用mw.log()和mw.logObject()来向控制台发送消息。

返回模块:Suppress categories