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: ensure namespaced attributes are reparented properly #2230

Merged
merged 5 commits into from May 11, 2021

Conversation

flavorjones
Copy link
Member

What problem is this PR intended to solve?

Fixes #2228.

Also:

  • introduces a change in Java/C formatting for case statements
  • fleshes out the CHANGELOG a bit for the next release
  • add some test coverage for existing namespaced attribute reparenting behavior
  • removes an unneeded xmlSetNs-after-reparent call

Have you included adequate test coverage?

Yes, test coverage adapted from #2228.

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

The Java implementation was already doing the right thing, this change only impacts CRuby behavior.

flavorjones and others added 5 commits May 11, 2021 01:45
also use xmlNodePtr->properties in place of xmlElementPtr->attributes
because it's clearer and requires less type gymnastics
The function `reparent_node_with` is already doing the right thing.
Previously, the namespace was dropped from the attribute.

Fixes #2228

Co-authored-by: Nikolaj Potashnikoff <34554890+fiddlededee@users.noreply.github.com>
@codeclimate
Copy link

codeclimate bot commented May 11, 2021

Code Climate has analyzed commit cd6941f and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 100.0% (80% is the threshold).

This pull request will bring the total coverage in the repository to 93.2% (0.0% change).

View more on Code Climate.

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] When copying between documents nokogiri strips attribute namespace if it differs from tag's
1 participant