Class: JsDuck::Util::HTML
- Inherits:
-
Object
- Object
- JsDuck::Util::HTML
- Defined in:
- lib/jsduck/util/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 < …
15 16 17 |
# File 'lib/jsduck/util/html.rb', line 15 def self.escape(html) CGI.escapeHTML(html) end |
.strip_tags(html) ⇒ Object
Strips tags from HTML text
10 11 12 |
# File 'lib/jsduck/util/html.rb', line 10 def self.(html) html.gsub(/<.*?>/, "") end |
.unescape(html) ⇒ Object
Unescapes HTML, replacing < with < …
20 21 22 |
# File 'lib/jsduck/util/html.rb', line 20 def self.unescape(html) CGI.unescapeHTML(html) end |