Module:Discord

local p = {}

function p.summary(frame) --Define vars linkPrefix = "https://splatoonwiki.org/wiki/" linkRegex = "%[%[[^%]%|]*%|?[^%]%|]*%]%]"   --Get input    summary = frame.args[1]

while string.find(summary, linkRegex) do     linkStart, linkEnd = string.find(summary, linkRegex) linkTxt = string.sub(summary, linkStart, linkEnd) if string.find(linkTxt, "|") then page = string.sub(string.match(linkTxt, "%[%[[^%]%|]*%|"), 3, -2)       text = string.sub(string.match(linkTxt, "%|[^%]%|]*%]%]"), 2, -3)        summary = summary:sub(0, linkStart-1) .. "[" .. text .. "](" .. linkPrefix .. string.gsub(page, " ", "%%20") .. ")" ..  summary:sub(linkEnd+1)      else        page = string.sub(string.match(linkTxt, "%[%[[^%]%|]*%]%]"), 3, -3)        summary = summary:sub(0, linkStart-1) .. "[" .. page .. "](" .. linkPrefix .. string.gsub(page, " ", "%%20") .. ")" ..  summary:sub(linkEnd+1)      end    end

return summary end

return p