Module:FormatLinks: Difference between revisions
Jump to navigation
Jump to search
MIXERRULES (talk | contribs) Added script to split links |
MIXERRULES (talk | contribs) m Minor edit |
||
Line 10: | Line 10: | ||
for i, Part in ipairs(Parts) do | for i, Part in ipairs(Parts) do | ||
if i == 1 then | if i == 1 then | ||
table.insert(Result, string.format("[%s %s]", Part, Part)) | table.insert(Result, string.format("[[%s %s]]", Part, Part)) | ||
else | else | ||
table.insert(Result, string.format("[%s %s]<br>", Part, Part)) | table.insert(Result, string.format("[[%s %s]]<br>", Part, Part)) | ||
end | end | ||
end | end |
Revision as of 22:38, 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 %s]]", Part, Part))
else
table.insert(Result, string.format("[[%s %s]]<br>", Part, Part))
end
end
return table.concat(Result)
end
return FormatLinksModuleDingus