Module:TemplateStarter: Difference between revisions

// via Wikitext Extension for VSCode
// via Wikitext Extension for VSCode
Line 22: Line 22:
     -- Sanitize input - remove any potentially harmful characters
     -- Sanitize input - remove any potentially harmful characters
     templateType = mw.text.trim(tostring(templateType))
     templateType = mw.text.trim(tostring(templateType))
   
    -- Debug: Add detailed error information
     if not templateType:match("^[%w_%-]+$") then
     if not templateType:match("^[%w_%-]+$") then
         return "Error: Invalid template type format"
         return string.format("Error: Invalid template type format. Received: '%s' (length: %d)", templateType, #templateType)
     end
     end