Module:FormatLinks: Difference between revisions

From The TF2 Sourcemod Wiki
Jump to navigation Jump to search
m Testing new line
m Testing
Tag: Reverted
Line 15: Line 15:
         end
         end
     end
     end
     return table.concat(Result)
     return mw.text.raw(table.concat(Result))
end
end


return FormatLinksModuleDingus
return FormatLinksModuleDingus

Revision as of 22:41, 15 December 2024

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

local FormatLinksModuleDingus = {}

function FormatLinksModuleDingus.Format(frame)
    local Input = frame.args[1] or ""
    local Parts = {}
    for Word in string.gmatch(Input, '([^,]+)') do
        table.insert(Parts, Word)
    end
    local Result = {}
    for i, Part in ipairs(Parts) do
        if i == 1 then
            table.insert(Result, string.format("[[%s]]", Part))
        else
            table.insert(Result, string.format("[[%s]]\n", Part))
        end
    end
    return mw.text.raw(table.concat(Result))
end

return FormatLinksModuleDingus