Module:ListGeneration: Difference between revisions
// via Wikitext Extension for VSCode |
// via Wikitext Extension for VSCode |
||
| Line 73: | Line 73: | ||
end | end | ||
-- If there's only one item and no | -- If there's only one item and no special formatting is needed, return it directly without list formatting | ||
if #items == 1 | if #items == 1 then | ||
local singleItem = items[1] | local singleItem = items[1] | ||
if type(singleItem) == 'table' then | local hasCustomBullet = (mode == 'bullet_custom' and bulletChar and bulletChar ~= '') | ||
local hasSpecialClass = (type(singleItem) == 'table' and singleItem.class and singleItem.class ~= '') | |||
-- Only bypass list formatting if there's no custom bullet AND no special class | |||
if not hasCustomBullet and not hasSpecialClass then | |||
if type(singleItem) == 'table' then | |||
return singleItem.content or '' | |||
else | |||
return singleItem | |||
end | |||
end | end | ||
-- If we have custom bullets or special classes, continue to list formatting below | |||
end | end | ||