Module:TrimArray: Difference between revisions
Appearance
Created page with "local p = {} function p.links(frame) local input = frame.args[1] or "" local form = frame.args.form or "Mineral" local out = {} for item in mw.text.gsplit(input, ",", true) do local trimmed = mw.text.trim(item) if trimmed ~= "" then table.insert(out, string.format( '{{#formredlink:form=%s|target=%s}}<br>', form, trimmed )) end end return table.concat(out) end return p" |
No edit summary |
||
| Line 3: | Line 3: | ||
function p.links(frame) | function p.links(frame) | ||
local input = frame.args[1] or "" | local input = frame.args[1] or "" | ||
local form = frame.args.form | local form = frame.args.form | ||
local out = {} | local out = {} | ||
Revision as of 20:50, 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, string.format(
'{{#formredlink:form=%s|target=%s}}<br>', form, trimmed
))
end
end
return table.concat(out)
end
return p