Skip to content
Browse files

Fix 'case' syntax for ruby 1.9, fix bad encoding

  • Loading branch information...
1 parent 1b10132 commit b776a01e25843365d60a89fd3a7a83bfe669b36a @tobym tobym committed Nov 1, 2010
Showing with 5 additions and 5 deletions.
  1. +5 −5 lib/readability.rb
View
10 lib/readability.rb
@@ -183,13 +183,13 @@ def class_weight(e)
def score_node(elem)
content_score = class_weight(elem)
case elem.name.downcase
- when "div":
+ when "div"
content_score += 5
- when "blockquote":
+ when "blockquote"
content_score += 3
- when "form":
+ when "form"
content_score -= 3
- when "th":
+ when "th"
content_score -= 5
end
{ :content_score => content_score, :elem => elem }
@@ -277,7 +277,7 @@ def sanitize(node, candidates, options = {})
end
# Get rid of duplicate whitespace
- node.to_html.gsub(/[\r\n\f]+/, "\n" ).gsub(/[\t  ]+/, " ")
+ node.to_html.gsub(/[\r\n\f]+/, "\n" ).gsub(/[\t ]+/, " ")
end
def clean_conditionally(node, candidates, selector)

0 comments on commit b776a01

Please sign in to comment.
Something went wrong with that request. Please try again.