Module:LuaTemplateBlueprint: Difference between revisions
// via Wikitext Extension for VSCode |
// via Wikitext Extension for VSCode |
||
| Line 929: | Line 929: | ||
end | end | ||
-- Process each value individually | -- Process each value individually | ||
for _, singleValue in ipairs(values) do | for _, singleValue in ipairs(values) do | ||
local trimmedValue = singleValue:match("^%s*(.-)%s*$") | local trimmedValue = singleValue:match("^%s*(.-)%s*$") | ||
if trimmedValue and trimmedValue ~= '' then | if trimmedValue and trimmedValue ~= '' then | ||
local | -- Apply transform if available | ||
if | local finalValue = trimmedValue | ||
if transform then | |||
finalValue = p.protectedExecute( | |||
template, | |||
'Transform_' .. property, | |||
function() return transform(trimmedValue, args, template) end, | |||
trimmedValue, | |||
trimmedValue, | |||
args, | |||
template | |||
) | |||
end | |||
-- Validate and add to collector | |||
finalValue = validatePropertyValue(finalValue) | |||
if finalValue and finalValue ~= '' then | |||
if not collector.properties[property] then | |||
collector.properties[property] = {} | |||
end | |||
table.insert(collector.properties[property], finalValue) | |||
collector.count = collector.count + 1 | |||
end | end | ||
end | end | ||