Describe the bug
Nokolexbor does not support leaf_elements.group_by(&:parent) like Nokogiri does.
The functionality difference seems like a purposeful performance tradeoff, so the actual bug may be in the lack of documentation, given that Nokolexbor is described as a drop-in replacement for Nokogiri.
I created a minimal Rspec example to demonstrate the breaking change.
For my use case, I found leaf_elements.group_by { |root| root.parent.to_s.hash + root.parent.element_children.size } to be an acceptable substitute.
Environment
- OS: MacOS 26
- Ruby version: 3.4.4
- Nokolexbor version: 0.7.0
Additional context
I discovered this discrepancy while working on my technical screen application for SerpApi!
Hopefully, this issue helps me beat my competition. 😂
Describe the bug
Nokolexbor does not support
leaf_elements.group_by(&:parent)like Nokogiri does.The functionality difference seems like a purposeful performance tradeoff, so the actual bug may be in the lack of documentation, given that Nokolexbor is described as a drop-in replacement for Nokogiri.
I created a minimal Rspec example to demonstrate the breaking change.
For my use case, I found
leaf_elements.group_by { |root| root.parent.to_s.hash + root.parent.element_children.size }to be an acceptable substitute.Environment
Additional context
I discovered this discrepancy while working on my technical screen application for SerpApi!
Hopefully, this issue helps me beat my competition. 😂