This binding is deprecated, and will be removed in September 2013. Use nokogumbo instead.
require 'gumbo-parser'
doc = GumboParser.parse(string)
-
The parse function takes a string and passes it to the
gumbo_parse_with_options
method, using the default options. The resulting Gumbo parse tree is the walked, producing a Nokogiri parse tree. The original Gumbo parse tree is then destroyed, and the Nokogiri parse tree is returned. -
Instead of uppercase element names, lowercase element names are produced.
-
Instead of returning 'unknown' as the element name for unknown tags, the original tag name is returned verbatim.
-
Nothing meaningful is done with the
GumboDocument
struct, i.e., no NokogiriEntityDecl
is produced.
-
Build and install the gumbo-parser C library
-
Change directory into the
ruby
subdirectory -
Execute
rake
- ruby-gumbo - a ruby binding for the Gumbo HTML5 parser.