rubys / nokogumbo

A Nokogiri interface to the Gumbo HTML5 parser.
Apache License 2.0
186 stars 114 forks source link

Use Gumbo's HTML fragment parsing API #102

Closed stevecheckoway closed 6 years ago

stevecheckoway commented 6 years ago

There are four basic APIs

  1. Nokogiri::HTML5.fragment(tags)
  2. Nokogiri::HTML5::DocumentFragment.new(doc, tags, ctx = nil)
  3. Nokogiri::HTML5::Document#fragment
  4. Nokogiri::XML::Node#fragment

The last creates a fragment using node as the context element.