Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What problem is this PR intended to solve?
See #2331 for context. I want to start getting things in place to make it possible to seamlessly switch to HTML5 parsing by default on supported platform. Part of this will require subclassing behavior to work properly (i.e., as Loofah expects it to, where a subclass of Nokogiri::HTML5::Document will return the appropriate subclass from
.parse
).This PR introduces that subclassing behavior, and makes all the HTML4 tests explicitly use
HTML4
instead ofHTML
.Note that
Gumbo.parse
now takes an additional argument, which is the class that should be used for the new document.Gumbo.parse
is considered to be an internal-only API and so this shouldn't be a breaking change, but it might be worth mentioning in release notes just in case.Have you included adequate test coverage?
Yes, additional coverage has been added to
test/html5/test_api.rb
Does this change affect the behavior of either the C or the Java implementations?
HTML5 only exists in the CRuby implementation