Module:LuaTemplateBlueprint: Difference between revisions
// via Wikitext Extension for VSCode |
// via Wikitext Extension for VSCode |
||
| Line 986: | Line 986: | ||
end | end | ||
-- Process additional properties with | -- Process additional properties with early deduplication and multi-value handling | ||
for property, fields in pairs(additionalProperties) do | for property, fields in pairs(additionalProperties) do | ||
-- Skip properties that are explicitly marked to skip | -- Skip properties that are explicitly marked to skip | ||
| Line 994: | Line 994: | ||
local rawValue = args[fieldName] | local rawValue = args[fieldName] | ||
if rawValue and rawValue ~= '' then | if rawValue and rawValue ~= '' then | ||
local | -- Handle multi-value fields by splitting first | ||
if | local values | ||
if rawValue:find(';') then | |||
values = TemplateHelpers.splitMultiValueString(rawValue) | |||
else | |||
values = {rawValue} | |||
end | |||
-- Process each value individually through deduplication | |||
for _, singleValue in ipairs(values) do | |||
local trimmedValue = singleValue:match("^%s*(.-)%s*$") | |||
if trimmedValue and trimmedValue ~= '' then | |||
local transformed = applyTransform(trimmedValue, property, transform, args, template) | |||
if transformed and transformed ~= '' then | |||
deduplicateProperty(collector, property, transformed) | |||
if | |||
end | end | ||
end | end | ||