Sha256: 29698f7f454956d163900edcee714da173564ffd7584c2d1c69a8055955ebccc

Contents?: true

Size: 412 Bytes

Versions: 12

Compression:

Stored size: 412 Bytes

Contents

require 'cgi'

module JsDuck

  # Helpers for dealing with HTML
  class HTML

    # Strips tags from HTML text
    def self.strip_tags(html)
      html.gsub(/<.*?>/, "")
    end

    # Escapes HTML, replacing < with &lt; ...
    def self.escape(html)
      CGI.escapeHTML(html)
    end

    # Unescapes HTML, replacing &lt; with < ...
    def self.unescape(html)
      CGI.unescapeHTML(html)
    end

  end

end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
jsduck-4.0.1 lib/jsduck/html.rb
jsduck-4.0.0 lib/jsduck/html.rb
jsduck-3.11.2 lib/jsduck/html.rb
jsduck-4.0.beta2 lib/jsduck/html.rb
jsduck-3.11.1 lib/jsduck/html.rb
jsduck-4.0.beta lib/jsduck/html.rb
jsduck-3.11.0 lib/jsduck/html.rb
jsduck-3.10.5 lib/jsduck/html.rb
jsduck-3.10.4 lib/jsduck/html.rb
jsduck-3.10.3 lib/jsduck/html.rb
jsduck-3.10.2 lib/jsduck/html.rb
jsduck-3.10.1 lib/jsduck/html.rb