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

fix: serializing an individual attribute in an HTML5 document #3127

Merged
merged 1 commit into from
Feb 8, 2024

Conversation

flavorjones
Copy link
Member

What problem is this PR intended to solve?

Previously an exception would be raised, either "Unexpected node" or "Unsupported document node (2)" depending on the version of Nokogiri.

Fixes #3125

Have you included adequate test coverage?

Yes.

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

HTML5 is only available in CRuby.

@flavorjones
Copy link
Member Author

@stevecheckoway I didn't extract the code into a separate function, but obviously will do that if you think it's best.

@flavorjones flavorjones force-pushed the flavorjones-3125-html5-attribute-to-html branch 2 times, most recently from b9c28cd to a84545e Compare February 6, 2024 19:35
Previously an exception would be raised, either "Unexpected node" or
"Unsupported document node (2)" depending on the version of Nokogiri.

Fixes #3125
@flavorjones flavorjones force-pushed the flavorjones-3125-html5-attribute-to-html branch from a84545e to 5ba752c Compare February 6, 2024 19:44
@stevecheckoway
Copy link
Contributor

LGTM!

The suggestion to extract the attribute serializing code to a function was just to avoid code duplication. Making a recursive call does that equally well.

@flavorjones flavorjones merged commit e67310b into main Feb 8, 2024
128 checks passed
@flavorjones flavorjones deleted the flavorjones-3125-html5-attribute-to-html branch February 8, 2024 02:57
@flavorjones flavorjones added this to the v1.17.0 milestone Jun 14, 2024
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.

[bug] Calling to_html on Nokogiri::XML::Attr raises Unsupported document node (2) exception
2 participants