Sha256: 1bc6ac7a8f3bc5ca8cc1296e7cb1f0e3e3a929bbd481813455338d6c30958bf8

Contents?: true

Size: 462 Bytes

Versions: 52

Compression:

Stored size: 462 Bytes

Contents

require 'cgi'

module JsDuck
  module Util

    # 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
end

Version data entries

52 entries across 52 versions & 3 rubygems

Version Path
solvas-jsduck-6.0.0.30539 lib/jsduck/util/html.rb
solvas-jsduck-6.0.0.9571 lib/jsduck/util/html.rb
solvas-jsduck-6.0.0.6154 lib/jsduck/util/html.rb
solvas-jsduck-6.0.0.4021 lib/jsduck/util/html.rb
solvas-jsduck-6.0.0.2554 lib/jsduck/util/html.rb
solvas-jsduck-6.0.0.1891 lib/jsduck/util/html.rb
solvas-jsduck-6.0.0.beta.1888 lib/jsduck/util/html.rb
jsduck-troopjs-0.0.10 lib/jsduck/util/html.rb
jsduck-troopjs-0.0.9 lib/jsduck/util/html.rb
jsduck-troopjs-0.0.8 lib/jsduck/util/html.rb
jsduck-troopjs-0.0.7 lib/jsduck/util/html.rb
jsduck-troopjs-0.0.5 lib/jsduck/util/html.rb
jsduck-troopjs-0.0.4 lib/jsduck/util/html.rb
jsduck-troopjs-0.0.3 lib/jsduck/util/html.rb
jsduck-troopjs-0.0.1 lib/jsduck/util/html.rb
jsduck-6.0.0beta lib/jsduck/util/html.rb
jsduck-5.3.4 lib/jsduck/util/html.rb
jsduck-5.3.3 lib/jsduck/util/html.rb
jsduck-5.3.2 lib/jsduck/util/html.rb
jsduck-5.3.1 lib/jsduck/util/html.rb