Class: Loofah::XML::DocumentFragment

Inherits:
Nokogiri::XML::DocumentFragment
  • Object
show all
Defined in:
lib/loofah/xml/document_fragment.rb

Overview

Subclass of Nokogiri::XML::DocumentFragment.

See Loofah::ScrubBehavior for additional methods.

Class Method Summary collapse

Class Method Details

.parse(tags) ⇒ Object

Overridden Nokogiri::XML::DocumentFragment

constructor. Applications should use Loofah.fragment to
parse a fragment.

16
17
18
19
20
# File 'lib/loofah/xml/document_fragment.rb', line 16

def parse(tags)
  doc = Loofah::XML::Document.new
  doc.encoding = tags.encoding.name if tags.respond_to?(:encoding)
  self.new(doc, tags)
end