Module:Infobox: Difference between revisions
Jump to navigation
Jump to search
Remove <br> tag detection - Now that we're purged br lists from the wiki the detection will generate too many false positives to be useful. Better to enforce with editor guidelines and patrolling
TriforceTony (talk | contribs) No edit summary |
PhantomCaleb (talk | contribs) (Remove <br> tag detection - Now that we're purged br lists from the wiki the detection will generate too many false positives to be useful. Better to enforce with editor guidelines and patrolling) |
||
(One intermediate revision by the same user not shown) | |||
Line 14: | Line 14: | ||
local CATEGORY_PARAM_CAPTION = "[[Category:Infoboxes using captions]]" | local CATEGORY_PARAM_CAPTION = "[[Category:Infoboxes using captions]]" | ||
local CATEGORY_PARAM_NAME = "[[Category:Infoboxes using the name parameter]]" | local CATEGORY_PARAM_NAME = "[[Category:Infoboxes using the name parameter]]" | ||
local CLASS_TOOLTIP = require("Module:Constants/class/tooltip") | local CLASS_TOOLTIP = require("Module:Constants/class/tooltip") | ||
local DEFAULT_IMG_SIZE = "320x320px" | local DEFAULT_IMG_SIZE = "320x320px" | ||
Line 37: | Line 35: | ||
if args.caption and args.caption ~= "" then | if args.caption and args.caption ~= "" then | ||
categories = categories..CATEGORY_PARAM_CAPTION | categories = categories..CATEGORY_PARAM_CAPTION | ||
end | end | ||
Line 92: | Line 83: | ||
return nil | return nil | ||
end | end | ||
games = utilsString.split(games) | |||
local gameLinks = utilsTable.map(games, p.link) | local gameLinks = utilsTable.map(games, p.link) | ||
Line 184: | Line 168: | ||
categories = categories..CATEGORY_INVALID_ARGS | categories = categories..CATEGORY_INVALID_ARGS | ||
end | end | ||
if | if listItems then | ||
listItems = utilsString.split(listItems, '%s*,%f[^,%d]%s*') -- %f[^,%d] is so we don't split numbers on their thousands separator (e.g., 1,500) | listItems = utilsString.split(listItems, '%s*,%f[^,%d]%s*') -- %f[^,%d] is so we don't split numbers on their thousands separator (e.g., 1,500) | ||
table.insert(blocks, { | table.insert(blocks, { | ||
game = game, | game = game, | ||
Line 385: | Line 362: | ||
{ | { | ||
args = {"OoT, invalid game, TP"}, | args = {"OoT, invalid game, TP"}, | ||
}, | }, | ||
} | } |