cantino / ruby-readability

Port of arc90's readability project to Ruby
Apache License 2.0
919 stars 170 forks source link

Avoid "could not reparent node" error when removing every tag. #52

Closed magic003 closed 10 years ago

magic003 commented 10 years ago

This is a fix for issue #50.

When trying to remove all tags from the doc, the "could not reparent node" is thrown from Nokogiri. That's because we are reparenting a root node. Some logic is added to check if it is root to avoid the error.

cantino commented 10 years ago

Thank you @magic003, much appreciated!

(The failed build is due to nokogiri no longer supporting Ruby 1.8.7, which is fine. I'm going to remove it from the build matrix since it's no longer a supported Ruby version.)