lib/readability.rb in ruby-readability-0.2.1 vs lib/readability.rb in ruby-readability-0.2.2
- old
+ new
@@ -181,17 +181,17 @@
end
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 }
end
@@ -275,10 +275,10 @@
end
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)
return unless @clean_conditionally
node.css(selector).each do |el|