Jump to content
Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Documentation for this module may be created at Module:AbilityBoxes/doc

local p = {}

function p.parse(frame)
    -- Get the input from the first argument passed to the module
    local input = frame.args[1] or ""
    
    -- Split the input string by commas
    local abilities = {}
    for ability in string.gmatch(input, "([^,]+)") do
        table.insert(abilities, ability:match("^%s*(.-)%s*$")) -- Trim whitespace
    end
    
    -- Wrap each ability in the AbilityBox template
    local result = {}
    for _, ability in ipairs(abilities) do
        table.insert(result, "{{AbilityBox|Ability:" .. ability .. "}}")
    end
    
    -- Return the concatenated result
    return frame:preprocess(table.concat(result))
end

return p