Palavras-chave: HTML, escape, escapar, cgi
Para “escapar” e “desescapar” caracteres especiais HTML:
require "cgi" s = CGI.escapeHTML("a > x && y < 0") puts s puts CGI.unescapeHTML(s)
Rodando:
a > x && y < 0 a > x && y < 0
Palavras-chave: HTML, escape, escapar, cgi
Para “escapar” e “desescapar” caracteres especiais HTML:
require "cgi" s = CGI.escapeHTML("a > x && y < 0") puts s puts CGI.unescapeHTML(s)
Rodando:
a > x && y < 0 a > x && y < 0