Jump to content

Module:Commalink

From Ulrapedia
Revision as of 04:03, 5 June 2026 by Mr.Dungeon (talk | contribs) (Created page with "local p = {} function p.link(frame) local input = frame.args[1] or "" if input == "" then return "" end local result = {} for item in string.gmatch(input, "([^,]+)") do item = item:match("^%s*(.-)%s*$") table.insert(result, "" .. item .. "") end return table.concat(result, ", ") end return p")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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

local p = {}

function p.link(frame)
    local input = frame.args[1] or ""
    if input == "" then return "" end
    
    local result = {}
    for item in string.gmatch(input, "([^,]+)") do
        item = item:match("^%s*(.-)%s*$")
        table.insert(result, "[[" .. item .. "]]")
    end
    
    return table.concat(result, ", ")
end

return p