rubys / nokogumbo

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

Error handling #127

Closed stevecheckoway closed 5 years ago

stevecheckoway commented 5 years ago

The parser and a bit of the tokenizer returned false if there was a parse error. This code was not well tested and definitely had errors. Since all errors go through a single gumbo_add_error function, that can set a member of the GumboOutput to indicate if there are any errors.

This is only used to stop parsing on the first error, although we could expose it to ruby for clients who wish to know if there was a parsing error but don't care what the error is.