Module:Introspection utils: Difference between revisions

Ganaram inukshuk (talk | contribs)
bugfix invocation detector
Ganaram inukshuk (talk | contribs)
mNo edit summary
Line 335: Line 335:
-- names as part of an #invoke statement
-- names as part of an #invoke statement
function normalize_module_name(mod_name)
function normalize_module_name(mod_name)
if not mod_name then return nil end
    if not mod_name then return nil end
-- Trim whitespace
    -- Trim whitespace
mod_name = mw.text.trim(mod_name)
    mod_name = mw.text.trim(mod_name)
-- Replace spaces with underscores
    -- Replace spaces with underscores
mod_name = mod_name:gsub(" ", "_")
    mod_name = mod_name:gsub(" ", "_")
-- Leave module name in snake_case
    -- Leave as snake case
return mod_name
    return mod_name
end
end