Module:Sandbox/User:Microbrews/Variants: Difference between revisions
Jump to navigation
Jump to search
Content added Content deleted
Microbrews (talk | contribs) No edit summary |
Microbrews (talk | contribs) No edit summary |
||
Line 42: | Line 42: | ||
variant_name = variant_name:gsub('^%s*(.-)%s*$', '%1') -- trim whitespace |
variant_name = variant_name:gsub('^%s*(.-)%s*$', '%1') -- trim whitespace |
||
variant_name = variant_name:gsub('%((.-)%)$', '%1') -- trim parentheses |
variant_name = variant_name:gsub('%((.-)%)$', '%1') -- trim parentheses |
||
variant_name = variant_name:gsub("^%l", string.upper) -- capitalize first letter |
|||
table.insert(formatted, '[[' .. name .. '|' .. variant_name .. ']]') |
table.insert(formatted, '[[' .. name .. '|' .. variant_name .. ']]') |
||
end |
end |