Editing Module:Param Parse
Jump to navigation
Jump to search
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 456: | Line 456: | ||
end |
end |
||
function parse.variant_category_func(v) |
function parse.variant_category_func(v) |
||
v = parse.has_content(v) |
|||
if v == nil then |
if v == nil then |
||
return nil |
return nil |
||
Line 477: | Line 476: | ||
end |
end |
||
local function name_without_variant_category(name, variant_name) |
local function name_without_variant_category(name, variant_name) |
||
variant_name = |
if name:sub(-1-#variant_name) == ' '..variant_name then |
||
if variant_name and name:sub(-1-#variant_name) == ' '..variant_name then |
|||
-- Ends with the variant name. Remove it |
-- Ends with the variant name. Remove it |
||
name = name:sub(1, -2-#variant_name) |
name = name:sub(1, -2-#variant_name) |
||
Line 485: | Line 483: | ||
end |
end |
||
local function name_with_variant_category(name, v, passive, is_for_smw) |
local function name_with_variant_category(name, v, passive, is_for_smw) |
||
v = parse.variant_smw_func(v) |
|||
if v == nil then |
if v == nil then |
||
return name |
return name |