Module:SemanticAnnotations: Difference between revisions
// via Wikitext Extension for VSCode Tag: Reverted |
// via Wikitext Extension for VSCode Tag: Reverted |
||
| Line 229: | Line 229: | ||
local fullPropertyName = prefix .. property | local fullPropertyName = prefix .. property | ||
if type(mapping) == "string" then | if type(mapping) == "table" and mapping[1] then | ||
-- This is a direct array of values, not a mapping definition. | |||
-- Use these values directly. | |||
for _, value in ipairs(mapping) do | |||
processSimpleMapping(properties, fullPropertyName, value, transform[property], default[property]) | |||
end | |||
elseif type(mapping) == "string" then | |||
-- Simple string mapping with case-insensitive lookup | -- Simple string mapping with case-insensitive lookup | ||
-- Try exact match first, then lowercase | |||
local value = args[mapping] or args[mapping:lower()] | local value = args[mapping] or args[mapping:lower()] | ||
processSimpleMapping(properties, fullPropertyName, value, transform[property], default[property]) | |||
elseif type(mapping) == "table" then | elseif type(mapping) == "table" then | ||
if mapping.param then | if mapping.param then | ||