Module:Sports series: Difference between revisions

Content deleted Content added
updating module code with additional features/improvements. Removing the type=NT feature, as this becomes too complex with men/women, senior/youth, past flag variants, using alternative display names, placeholders, generating match links, etc. All this is better done by using the {{fb}} series of templates
improve matching logic
Line 341:
local function cleanTeam(str, defaultName)
if str and str ~= "" then
str = str:gsub('<sup.->.-</sup>', '')
str = str:gsub("</?%w+[^>]*>", "")
str = str:gsub('\127%\'"`UNIQ.-QINU`"%\'\127', '')
Line 346 ⟶ 347:
str = str:gsub("%[%[[Ii]mage:[^%]]+%]%]", "")
str = str:gsub("%[%[.-%]%]", replaceLink)
str = str:gsub("%s*&nbsp;%s*", "")
str = str:match("^%s*(.-)%s*$") -- Remove leading and trailing whitespace
return str ~= "" and str or defaultName