Module:Chat: Difference between revisions

From Growtopia
Jump to navigationJump to search
>NekoPillow
mNo edit summary
>NekoPillow
mNo edit summary
Line 1: Line 1:
local chat = {}
local chat = {}


function chat.parse(frame)
function chat.parse(frame)
     local input1 = frame.args[1]
     local input1 = frame.args[1]
    local count = 0
     local output1 = (input1:gsub("`[0-9wobpqertas!@#$^&]",function(c)
     local output1 = (input1:gsub("`[0-9wobpqertas!@#$^&]",function(c)
         local code = c:sub(2,2)
         local code = c:sub(2,2)
        count = count+1


         return "</span><span style='"..code.."'>"
         return "<span style='"..code.."'>"
     end))
     end))
      
      
     return "<span>"..output1.."</span>"
     return output1..string.rep("</span>",count)
end
end


return chat
return chat

Revision as of 05:40, 24 January 2019

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-9wobpqertas!@#$^&]",function(c)
        local code = c:sub(2,2)
        count = count+1

        return "<span style='"..code.."'>"
    end))
    
    return output1..string.rep("</span>",count)
end

return chat