Module:Seealso

From Derivative
Jump to navigation Jump to search

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

local str = {}

local function tableToString(t)
    local key
    local value
    local result

    result = ''

    for key, value in pairs(t) do
        if (tonumber(key) ~= nil) then
            for i in string.gmatch(value, "%S+") do
                result = result .. '[[#' .. i .. '|' .. i .. ']] ' 
            end
        else
            result = result .. '[[#' .. value .. ']] ' 
        end
    end
 
    return result
end

function str.list(frame)
    return tableToString(frame.args)
end

return str