Module:TrimArray: Difference between revisions
Appearance
No edit summary |
No edit summary |
||
| Line 9: | Line 9: | ||
local trimmed = mw.text.trim(item) | local trimmed = mw.text.trim(item) | ||
if trimmed ~= "" then | if trimmed ~= "" then | ||
table.insert(out, string.format( | table.insert(out, frame:expandTemplate(string.format( | ||
'{{#formredlink:form=%s|target=%s}} | '{{#formredlink:form=%s|target=%s}}', form, trimmed | ||
)) | )) "<br>") | ||
end | end | ||
end | end | ||
Revision as of 20:55, 28 October 2025
Documentation for this module may be created at Module:TrimArray/doc
local p = {}
function p.links(frame)
local input = frame.args[1] or ""
local form = frame.args.form
local out = {}
for item in mw.text.gsplit(input, ",", true) do
local trimmed = mw.text.trim(item)
if trimmed ~= "" then
table.insert(out, frame:expandTemplate(string.format(
'{{#formredlink:form=%s|target=%s}}', form, trimmed
)) "<br>")
end
end
return table.concat(out)
end
return p