Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use the correct classes for fragment parsing #2388

Merged
merged 2 commits into from Dec 20, 2021

Conversation

flavorjones
Copy link
Member

What problem is this PR intended to solve?

#1158 reported a bug whose root cause is the use of incorrect class (Nokogiri::HTML4::DocumentFragment instead of Nokogiri::XML::DocumentFragment) during fragment parse error recovery.

This PR introduces a new mixin, Nokogiri::ClassResolver for the few places in the codebase where an appropriate class needs to be chosen. (For example, a node in a Nokogiri::XML::Document needing to use the related DocumentFragment class.) ClassResolver is now used for fragment parsing as well as Builder document creation.

Have you included adequate test coverage?

Yes!

Does this change affect the behavior of either the C or the Java implementations?

No.

@flavorjones flavorjones changed the title 1158 use the right classes use the correct classes for fragment parsing Dec 16, 2021
@flavorjones flavorjones force-pushed the 1158-use-the-right-classes branch 2 times, most recently from 4a23e2c to 2d02024 Compare December 16, 2021 15:29
Introduce ClassResolver which will do the class lookup correctly, and
use it for Builder and for fragment parsing.

Closes #1158
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant