Permalink
Browse files

Release 0.3.5

- Fixes for recent versions of hpricot:
- Fix fatal error scrubbing anything that has no children (such as an EmptyElem)
- Fix fatal error removing elements with no children
  • Loading branch information...
1 parent 31a3c14 commit b4beba2c6db48112aaad013d529a747aa597c3b1 Mina Naguib committed Mar 31, 2009
Showing with 19 additions and 3 deletions.
  1. +7 −0 CHANGELOG.txt
  2. +6 −2 lib/hpricot_scrub/hpricot_scrub.rb
  3. +1 −1 lib/hpricot_scrub/version.rb
  4. +5 −0 test/hpricot_scrub_test.rb
View
@@ -1,3 +1,10 @@
+2009-03-30 Mina Naguib <mina.hpricotscrub@naguib.ca>
+ Release 0.3.5
+ - Fixes for recent versions of hpricot:
+ - Fix fatal error scrubbing anything that has no children (such as an
+ EmptyElem)
+ - Fix fatal error removing elements with no children
+
2008-11-02 Michael <michael@underpantsgnome.com>
Release 0.3.4
- Fix gem command test - Thanks David Masover
@@ -167,7 +167,11 @@ def remove
end
def strip
- swap(inner_html)
+ if (i = inner_html) != ""
+ swap(i)
+ else
+ remove
+ end
end
#
@@ -189,7 +193,7 @@ def scrub(config = nil)
config = Scrub::normalize_config(config)
- children.reverse.each do |child|
+ (children || []).reverse.each do |child|
child.scrub(config) if child.scrubbable?
end
@@ -2,7 +2,7 @@ module HpricotScrub #:nodoc:
module VERSION #:nodoc:
MAJOR = 0
MINOR = 3
- TINY = 4
+ TINY = 5
STRING = [MAJOR, MINOR, TINY].join('.')
end
@@ -93,6 +93,11 @@ def test_elem_rule_proc
end
end
+ def test_elem_emptyelem
+ h = Hpricot("<br>")
+ assert_equal "", h.scrub.to_s
+ end
+
def test_attr_default_rule_removes
@scrubbed_docs.each do |doc|
assert_equal 0, doc.search("*[@mce_src]").length

0 comments on commit b4beba2

Please sign in to comment.