Module:SemanticAnnotations: Difference between revisions

// via Wikitext Extension for VSCode
Tag: Reverted
// via Wikitext Extension for VSCode
Tag: Manual revert
Line 229: Line 229:
         local fullPropertyName = prefix .. property
         local fullPropertyName = prefix .. property
          
          
         if type(mapping) == "table" and mapping[1] then
         if type(mapping) == "string" 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])
             propertyCount = propertyCount + addSimplePropertyToResult(result,  
                fullPropertyName, value, transform[property], default[property])
         elseif type(mapping) == "table" then
         elseif type(mapping) == "table" then
             if mapping.param then
             if mapping.param then
Line 320: Line 314:
         local fullPropertyName = prefix .. property
         local fullPropertyName = prefix .. property
          
          
         if type(mapping) == "table" and mapping[1] then
         if type(mapping) == "string" 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
             -- Try exact match first, then lowercase