<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -74,14 +74,17 @@ module FeedNormalizer
 
         # Remove attributes that aren't on the whitelist, or are suspicious URLs.
         (doc/remaining_tags.join(&quot;,&quot;)).each do |element|
+          next if element.raw_attributes.nil? || element.raw_attributes.empty?
           element.raw_attributes.reject! do |attr,val|
             !HTML_ATTRS.include?(attr) || (HTML_URI_ATTRS.include?(attr) &amp;&amp; dodgy_uri?(val))
           end
 
           element.raw_attributes = element.raw_attributes.build_hash {|a,v| [a, add_entities(v)]}
         end unless remaining_tags.empty?
-
-        doc.traverse_text {|t| t.set(add_entities(t.to_html))}
+        
+        doc.traverse_text do |t|
+          t.swap(add_entities(t.to_html))
+        end
 
         # Return the tree, without comments. Ugly way of removing comments,
         # but can't see a way to do this in Hpricot yet.
@@ -176,15 +179,3 @@ module Enumerable #:nodoc:
     result
   end
 end
-
-# http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/207625
-#  Subject: A simple Hpricot text setter
-#  From: Chris Gehlker &lt;canyonrat mac.com&gt;
-#  Date: Fri, 11 Aug 2006 03:19:13 +0900
-class Hpricot::Text #:nodoc:
-  def set(string)
-    @content = string
-    self.raw_string = string
-  end
-end
-</diff>
      <filename>lib/html-cleaner.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>e65e138360f92c83e32fc2c12fe9b89cdada0007</id>
    </parent>
  </parents>
  <author>
    <name>Marcel Scherf</name>
    <email>marcel.scherf@gmail.com</email>
  </author>
  <url>http://github.com/aasmith/feed-normalizer/commit/44299856582d1a43b668fe145aa08fb548b44b41</url>
  <id>44299856582d1a43b668fe145aa08fb548b44b41</id>
  <committed-date>2009-04-23T14:32:41-07:00</committed-date>
  <authored-date>2009-04-19T13:28:37-07:00</authored-date>
  <message>removed raw_string= call

Signed-off-by: Andrew A Smith &lt;andy@tinnedfruit.org&gt;</message>
  <tree>9b6d31761756a6c0e52121b660f1998672e352c3</tree>
  <committer>
    <name>Andrew A Smith</name>
    <email>andy@tinnedfruit.org</email>
  </committer>
</commit>
