Google has opened Gumbo source code, which is an HTML Parsing Library written in C. The library complies with HTML parsing algorithm standards and has passed all html5lib-0.95 tests and has been tested on the 2.5 billion web pages of Google indexing.
According to the description page of the project, Google released Gumbo to provide developers with a lightweight HTML Parser library without external dependencies and can be called in most languages. This library can be included in applications such as Web page validators, static analyzer, template language, and refactoring tools.
Google believes that Gumbo is "robust and flexible for low-standard input", But ABI may change in the future, therefore, it is not recommended to maintain pointers to some internal data structures of Gumbo. However, this API is considered quite stable. Gumbo 1.0 will be released in the near future. Prior to this, the project team will be waiting for developers' opinions.
The following are some features that will be added in the future: 1. Support for recent HTML5 specification changes to support template tags 2. Support for fragment parsing 3. full-featured error reports 4. Binding in other languages
Before the HTML5 parsing algorithm is standardized, Each browser chooses how to mark the input page and how to render the page. Although HTML 4 provides a detailed description of valid tags, it does not indicate what the browser should do when the input is invalid. Therefore, 95% of Web pages in the world cannot be verified by the W3C reference validators. Using tools like Gumbo to verify HTML pages ensures that pages are properly parsed and rendered in all major browsers.
Google Open Sources Gumbo, An HTML5 Parsing Library