Today, Module:AfC submission catcheck/sandbox is a topic that has captured the attention of people of all ages and backgrounds. Since its emergence, Module:AfC submission catcheck/sandbox has generated increasing interest and has become a central element in the discussion of various aspects of daily life. Whether in the workplace, in education, in politics or in entertainment, Module:AfC submission catcheck/sandbox has proven to be a relevant and current topic that deserves to be analyzed in depth. In this article, we will explore different perspectives on Module:AfC submission catcheck/sandbox and examine its impact on today's society.
| This is the module sandbox page for Module:AfC submission catcheck (diff). See also the companion subpage for test cases (run). |
| This module is rated as ready for general use. It has reached a mature state, is considered relatively stable and bug-free, and may be used wherever appropriate. It can be mentioned on help pages and other Wikipedia resources as an option for new users. To minimise server load and avoid disruptive output, improvements should be developed through sandbox testing rather than repeated trial-and-error editing. |
This module is used by Template:AFC submission and its subtemplates to scan the content of AFC submissions. It's used to allow finding of drafts in improper content categories as well as to suppress the message that a draft has not been submitted when in fact it has been.
local p = {}
local function removeFalsePositives(str)
if not str then
return ''
end
str = mw.ustring.gsub(str, "<!--.--->", "")
str = mw.ustring.gsub(str, "<nowiki>.-</nowiki>", "")
str = mw.ustring.gsub(str, "{{raft ategories-{{-}}-}}", "")
str = mw.ustring.gsub(str, "{{raft ategories.-}}", "")
str = mw.ustring.gsub(str, "{{raftcat-{{-}}-}}", "")
str = mw.ustring.gsub(str, "{{raftcat.-}}", "")
str = mw.ustring.gsub(str,"%%]","")
str = mw.ustring.gsub(str,"%rafts?.-%]%]","")
str = mw.ustring.gsub(str,"%%]","")
return str
end
function p.checkforcats(frame)
local t = mw.title.getCurrentTitle()
tc = t:getContent()
if tc == nil then
return ""
end
tc = removeFalsePositives(tc)
if mw.ustring.match(tc, "%ategory:" ) == nil then
return ""
else
return "]"
end
end
function p.submitted(frame)
local text = removeFalsePositives(mw.title.getCurrentTitle():getContent())
if mw.ustring.find(text, '{{AfC submission||', 1, true) or mw.ustring.find(text, '{{AFC submission||', 1, true) then
return frame.args
else
return frame.args
end
end
return p