Sha256: c1f172e4842e0a032cbc43404ec94695142b69c5dd53decc9d994f32ef79ff91

Contents?: true

Size: 553 Bytes

Versions: 3

Compression:

Stored size: 553 Bytes

Contents

module Loofah
  module HTML # :nodoc:
    #
    #  Subclass of Nokogiri::HTML::Document.
    #
    #  See Loofah::ScrubBehavior and Loofah::DocumentDecorator for additional methods.
    #
    class Document < Nokogiri::HTML::Document
      include Loofah::ScrubBehavior::Node
      include Loofah::DocumentDecorator

      #
      #  Returns a plain-text version of the markup contained by the document
      #
      def text
        xpath("/html/body").inner_text
      end
      alias :inner_text :text
      alias :to_str     :text
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
loofah-0.4.4 lib/loofah/html/document.rb
loofah-0.4.3 lib/loofah/html/document.rb
loofah-0.4.2 lib/loofah/html/document.rb