Module:T7/ComboRow

From SuperCombo Wiki
Revision as of 22:10, 11 May 2025 by Emerald3ME (talk | contribs) (Created page with "local p = {} function trim(s) return s:match('^%s*(.-)%s*$') end function p.comboRow(frame) local input = frame.args[1] or '' local delimiter = frame.args.delimiter or ',' local out = {} for token in string.gmatch(input, '([^'..delimiter..']+)') do token = trim(token) table.insert(out, string.format("{{Icon-TKC|%s}}", token)) end return table.concat(out) end return p")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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

local p = {}

function trim(s)
    return s:match('^%s*(.-)%s*$')
end

function p.comboRow(frame)
    local input = frame.args[1] or ''
    local delimiter = frame.args.delimiter or ','

    local out = {}
    for token in string.gmatch(input, '([^'..delimiter..']+)') do
        token = trim(token)
        table.insert(out, string.format("{{Icon-TKC|%s}}", token))
    end

    return table.concat(out)
end

return p