Class: JsDuck::HTML
- Inherits:
-
Object
- Object
- JsDuck::HTML
- Defined in:
- lib/jsduck/html.rb
Overview
Helpers for dealing with HTML
Class Method Summary collapse
-
.escape(html) ⇒ Object
Escapes HTML, replacing < with < …
-
.strip_tags(html) ⇒ Object
Strips tags from HTML text.
-
.unescape(html) ⇒ Object
Unescapes HTML, replacing < with < …
Class Method Details
.escape(html) ⇒ Object
Escapes HTML, replacing < with < …
14 15 16 |
# File 'lib/jsduck/html.rb', line 14 def self.escape(html) CGI.escapeHTML(html) end |
.strip_tags(html) ⇒ Object
Strips tags from HTML text
9 10 11 |
# File 'lib/jsduck/html.rb', line 9 def self.(html) html.gsub(/<.*?>/, "") end |
.unescape(html) ⇒ Object
Unescapes HTML, replacing < with < …
19 20 21 |
# File 'lib/jsduck/html.rb', line 19 def self.unescape(html) CGI.unescapeHTML(html) end |