-
-
Notifications
You must be signed in to change notification settings - Fork 897
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: some Node reparent methods parse in context of parent
The choice of context node has no functional impact for Nokogiri per se; but it's necessary for Nokogumbo, which has a better HTML parser, to ensure the parser is in the right state. When testing this change against nodes without a parent, the test suite found memory problems related to libxml2 manipulating pointers on pickled nodes. As a result, the impacted methods now raise a RuntimeError if they're called on a node without a parent (the concept of a sibling or a replacement/swap doesn't make sense without the context of a parent to hold it together, anyway). Note that `Node#coerce` is now a __protected__ method (previously it was __private__). Impacted Node methods: - add_next_sibling, previous=, and before - add_previous_sibling, next=, and after - replace and swap Fixes rubys/nokogumbo#160
- Loading branch information
1 parent
a21a003
commit 46e33cc
Showing
6 changed files
with
115 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters