Browse files

Make hpricot a little less opinionated.

  • Loading branch information...
1 parent 14ecd85 commit 7bce530b7682de84e8c6c904590b135abc56430a @maxim committed Oct 20, 2009
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/html_press/html_press.rb
View
4 lib/html_press/html_press.rb
@@ -38,7 +38,7 @@ def compress
end
def compressed_html
- result = @dom.to_html
+ result = @dom.to_original_html
if original_html.size > result.size
result
else
@@ -60,7 +60,7 @@ def cleanup_elements!
def cleanup_style_attributes!
@dom.search("//*[@style]").each do |elem|
- elem.raw_attributes = elem.attributes.merge("style" => cleanup(elem.attributes["style"]))
+ elem.set_attribute("style", cleanup(elem.attributes["style"]))
end
end

0 comments on commit 7bce530

Please sign in to comment.