Difference between revisions of "Module:Team bracket tracking"

From blackwiki
Jump to navigation Jump to search
blackwiki>Frietjes
(Created page with 'local p = {} function p.tracking(frame) local args = frame:getParent().args for k, v in pairs(args) do local num = tostring(k):match('^RD[0-9]-team([0-9][0-...')
 
m (13 revisions imported)
 
(12 intermediate revisions by 2 users not shown)
Line 4: Line 4:
 
local args = frame:getParent().args
 
local args = frame:getParent().args
 
for k, v in pairs(args) do
 
for k, v in pairs(args) do
local num = tostring(k):match('^RD[0-9]-team([0-9][0-9]*)$')
+
if tostring(k):match('%-team[0-9]') then
if num then
+
if tostring(v):match('[Bb][Rr][^<>]*>[%s]*.[Nn][Bb][Ss][Pp]') then
if tostring(v):match('>[%s]*&[Nn][Bb][Ss][Pp]') then
+
return '[[Category:Pages using a team bracket with nbsp]]'
return '[[Category:Pages using a tennis bracket with nbsp]]'
+
end
 +
if tostring(v):match('[Bb][Rr][^<>]*>[%s]*<span[^<>]*>[%s]*.[Nn][Bb][Ss][Pp]') then
 +
return '[[Category:Pages using a team bracket with nbsp]]'
 
end
 
end
 
end
 
end

Latest revision as of 17:17, 29 September 2020

Documentation for this module may be created at Module:Team bracket tracking/doc

local p = {}

function p.tracking(frame)
	local args = frame:getParent().args
	for k, v in pairs(args) do
		if tostring(k):match('%-team[0-9]') then
			if tostring(v):match('[Bb][Rr][^<>]*>[%s]*.[Nn][Bb][Ss][Pp]') then
				return '[[Category:Pages using a team bracket with nbsp]]'
			end
			if tostring(v):match('[Bb][Rr][^<>]*>[%s]*<span[^<>]*>[%s]*.[Nn][Bb][Ss][Pp]') then
				return '[[Category:Pages using a team bracket with nbsp]]'
			end
		end
	end
	return ''
end

return p