Module:Chat: Difference between revisions
From Growtopia
Jump to navigationJump to search
>NekoPillow mNo edit summary |
>NekoPillow No edit summary |
||
| Line 5: | Line 5: | ||
local input1 = frame.args[1] | local input1 = frame.args[1] | ||
local count = 0 | local count = 0 | ||
local output1 = (input1:gsub("`[0- | local output1 = (input1:gsub("`[0-9wobpqertasc!@#$^&`]",function(c) | ||
local code = c:sub(2,2) | local code = c:sub(2,2) | ||
Revision as of 09:03, 8 March 2024
Documentation for this module may be created at Module:Chat/doc
local chat = {}
function chat.parse(frame)
local input1 = frame.args[1]
local count = 0
local output1 = (input1:gsub("`[0-9wobpqertasc!@#$^&`]",function(c)
local code = c:sub(2,2)
if(code=="`") then
if(count == 0) then return false end
count = count-1
return "</span>"
end
count = count+1
return "<span style='"..code.."'>"
end))
return output1..string.rep("</span>",count)
end
return chat