Jump to content

Module:TrimArray

From PanEcoDevWiki
Revision as of 20:23, 28 October 2025 by Admin (talk | contribs) (Created page with "local p = {} -- Function to convert a comma-separated list into clean formredlinks function p.mineralLinks(frame) local input = frame.args[1] or "" 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=Mineral|target=%s}}<br>', trimmed )) end end return table.concat(o...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

local p = {}

-- Function to convert a comma-separated list into clean formredlinks function p.mineralLinks(frame)

   local input = frame.args[1] or ""
   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(
               '%s
', trimmed )) end end
   return table.concat(out)

end

return p