Module: Ronin::Support::Encoding::HTML
- Defined in:
- lib/ronin/support/encoding/html.rb
Overview
Contains methods for encoding/decoding escaping/unescaping HTML data.
Features
- Supports lowercase (ex:
&
) and uppercase (ex:&
) encoding. - Supports decimal (ex:
A
) and hexadecimal (ex:A
) character encoding. - Supports zero-padding (ex:
A
).
Core-Ext Methods
Class Method Summary collapse
-
.decode(data) ⇒ String
Decoded the HTML encoded data.
-
.encode(data, **kwargs) ⇒ String
Encodes each character in the given data as an HTML character.
-
.encode_byte(byte, **kwargs) ⇒ String
Encodes the byte as a HTML decimal character.
-
.escape(data, **kwargs) ⇒ String
HTML escapes the data.
-
.escape_byte(byte, **kwargs) ⇒ String
Escapes the byte as a HTML decimal character.
-
.unescape(data) ⇒ String
Unescapes the HTML encoded data.
Class Method Details
.decode(data) ⇒ String
Decoded the HTML encoded data.
182 183 184 |
# File 'lib/ronin/support/encoding/html.rb', line 182 def self.decode(data) XML.decode(data) end |
.encode(data, **kwargs) ⇒ String
Encodes each character in the given data as an HTML character.
169 170 171 |
# File 'lib/ronin/support/encoding/html.rb', line 169 def self.encode(data,**kwargs) XML.encode(data,**kwargs) end |
.encode_byte(byte, **kwargs) ⇒ String
Encodes the byte as a HTML decimal character.
123 124 125 |
# File 'lib/ronin/support/encoding/html.rb', line 123 def self.encode_byte(byte,**kwargs) XML.encode_byte(byte,**kwargs) end |
.escape(data, **kwargs) ⇒ String
HTML escapes the data.
215 216 217 |
# File 'lib/ronin/support/encoding/html.rb', line 215 def self.escape(data,**kwargs) XML.escape(data,**kwargs) end |
.escape_byte(byte, **kwargs) ⇒ String
Escapes the byte as a HTML decimal character.
77 78 79 |
# File 'lib/ronin/support/encoding/html.rb', line 77 def self.escape_byte(byte,**kwargs) XML.escape_byte(byte,**kwargs) end |