Module:ListGeneration: Difference between revisions
// via Wikitext Extension for VSCode |
// via Wikitext Extension for VSCode |
||
| Line 52: | Line 52: | ||
local items | local items | ||
if type(input) == 'string' then | if type(input) == 'string' then | ||
items = NormalizationText.splitMultiValueString(input) | -- Default to splitting only by semicolon. This is a safer default than also splitting by "and", which can break up valid entity names. | ||
-- Callers that need more complex splitting logic should pre-split the string and pass a table instead. | |||
local semicolonOnlyPattern = {{pattern = ";%s*", replacement = ";"}} | |||
items = NormalizationText.splitMultiValueString(input, semicolonOnlyPattern) | |||
else | else | ||
items = input | items = input | ||