Module:Chat: Difference between revisions

From Growtopia
Jump to navigationJump to search
>NekoPillow
mNo edit summary
>NekoPillow
No edit summary
Line 4: Line 4:
     local str = frame.args[1]
     local str = frame.args[1]
      
      
     return str:gsub("`[0-9wobpqertas!@#$^&`]",function(c)
     return (str:gsub("`[0-9wobpqertas!@#$^&`]",function(c)
        local code = c:sub(2,2)
          
          
         return c:sub(2,2)
         if(code == "`") then return "</span>" end
     end)
        return "<span style='"..code.."'>"
     end))
end
end


return chat
return chat

Revision as of 05:09, 24 January 2019

Documentation for this module may be created at Module:Chat/doc

local chat = {}

function chat.parse(frame)
    local str = frame.args[1]
    
    return (str:gsub("`[0-9wobpqertas!@#$^&`]",function(c)
        local code = c:sub(2,2)
        
        if(code == "`") then return "</span>" end
        return "<span style='"..code.."'>"
    end))
end

return chat