class JsDuck::Util::HTML

Helpers for dealing with HTML

Public Class Methods

escape(html) click to toggle source

Escapes HTML, replacing < with &lt; …

# File lib/jsduck/util/html.rb, line 15
def self.escape(html)
  CGI.escapeHTML(html)
end
strip_tags(html) click to toggle source

Strips tags from HTML text

# File lib/jsduck/util/html.rb, line 10
def self.strip_tags(html)
  html.gsub(/<.*?>/, "")
end
unescape(html) click to toggle source

Unescapes HTML, replacing &lt; with < …

# File lib/jsduck/util/html.rb, line 20
def self.unescape(html)
  CGI.unescapeHTML(html)
end