Subclass of Nokogiri::HTML::DocumentFragment.
See Loofah::ScrubBehavior and Loofah::TextBehavior for additional methods.
Overridden Nokogiri::HTML::DocumentFragment constructor. Applications should use Loofah.fragment to parse a fragment.
# File lib/loofah/html/document_fragment.rb, line 17 def parse tags doc = Loofah::HTML::Document.new doc.encoding = tags.encoding.name if tags.respond_to?(:encoding) self.new(doc, tags) end
# File lib/loofah/html/document_fragment.rb, line 32 def serialize_root at_xpath("./body") || self end