http://proplan.55bet-pro.com/wiki/index.php?action=history&feed=atom&title=M%C3%B3dulo%3ASuppress_categoriesMódulo:Suppress categories - Histórico de revisão-55BET Pro2026-03-28T03:00:04ZHistórico de revisões para esta página neste wikiMediaWiki 1.42.7http://proplan.55bet-pro.com/wiki/index.php?title=M%C3%B3dulo:Suppress_categories&diff=177&oldid=prevMódulo:Suppress categories - Histórico de revisão-55BET Pro2024-06-27T11:12:00Z<p>uma edição</p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<tr class="diff-title" lang="pt-BR">
<td colspan="1" style="background-color: #fff; color: #202122; text-align: center;">← Edição anterior</td>
<td colspan="1" style="background-color: #fff; color: #202122; text-align: center;">Edição das 08h12min de 27 de junho de 2024</td>
</tr><tr><td colspan="2" class="diff-notice" lang="pt-BR"><div class="mw-diff-empty">(Sem diferença)</div>
</td></tr></table>Henryzordhttp://proplan.55bet-pro.com/wiki/index.php?title=M%C3%B3dulo:Suppress_categories&diff=176&oldid=prevMódulo:Suppress categories - Histórico de revisão-55BET Pro2021-10-26T17:25:37Z<p>Changed protection settings for "<a href="/wiki/M%C3%B3dulo:Suppress_categories" title="Módulo:Suppress categories">Module:Suppress categories</a>": <a href="http://en.wikipedia.org/wiki/High-risk_templates" class="extiw" title="wikipedia:High-risk templates">High-risk template or module</a>: 2510 transclusions (<a href="/wiki/index.php?title=Usu%C3%A1rio:MusikBot_II/TemplateProtector&action=edit&redlink=1" class="new" title="Usuário:MusikBot II/TemplateProtector (página inexistente)">more info</a>) ([Edit=Require extended confirmed access] (indefinite) [Move=Require extended confirmed access] (indefinite))</p>
<p><b>Página nova</b></p><div>-- This is a simple module to strip categories from wikitext. It does<br />
-- not support nested links or magic words like __TOC__, etc. Even so,<br />
-- it should still handle most categories.<br />
<br />
local p = {}<br />
<br />
-- Detects if a category link is valid or not. If it is valid,<br />
-- the function returns the blank string. If not, the input<br />
-- is returned with no changes.<br />
local function processCategory( all, submatch )<br />
local beforePipe = mw.ustring.match( submatch, '^(.-)[%s_]*|[%s_]*.-$' )<br />
beforePipe = beforePipe or submatch<br />
if mw.ustring.match( beforePipe, '[%[%]<>{}%c\n]' ) then<br />
return all<br />
else<br />
return ''<br />
end<br />
end<br />
<br />
-- Preprocess the content if we aren't being called from #invoke,<br />
-- and pass it to gsub to remove valid category links.<br />
local function suppress( content, isPreprocessed )<br />
if not isPreprocessed then<br />
content = mw.getCurrentFrame():preprocess( content )<br />
end<br />
content = mw.ustring.gsub(<br />
content,<br />
'(%[%[[%s_]*[cC][aA][tT][eE][gG][oO][rR][yY][%s_]*:[%s_]*(.-)[%s_]*%]%])',<br />
processCategory<br />
)<br />
return content<br />
end<br />
<br />
-- Get the content to suppress categories from, and find<br />
-- whether the content has already been preprocessed. (If the<br />
-- module is called from #invoke, it has been preprocessed already.)<br />
function p.main( frame )<br />
local content, isPreprocessed<br />
if frame == mw.getCurrentFrame() then<br />
content = frame:getParent().args[1]<br />
if frame.args[1] then<br />
content = frame.args[1]<br />
end<br />
isPreprocessed = true<br />
else<br />
content = frame<br />
isPreprocessed = false<br />
end<br />
return suppress( content, isPreprocessed )<br />
end<br />
<br />
return p</div>infobox>MusikBot II