Method: Nokogiri::XML::DocumentFragment#to_html

Defined in:
lib/nokogiri/xml/document_fragment.rb

#to_html(*args) ⇒ Object

Convert this DocumentFragment to html See Nokogiri::XML::NodeSet#to_html



43
44
45
46
47
48
49
50
51
52
# File 'lib/nokogiri/xml/document_fragment.rb', line 43

def to_html *args
  if Nokogiri.jruby?
    options = args.first.is_a?(Hash) ? args.shift : {}
    if !options[:save_with]
      options[:save_with] = Node::SaveOptions::NO_DECLARATION | Node::SaveOptions::NO_EMPTY_TAGS | Node::SaveOptions::AS_HTML
    end
    args.insert(0, options)
  end
  children.to_html(*args)
end