busk-ruby-readability 1.0.5.1 → 1.0.5.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/readability.rb +3 -2
  2. metadata +4 -4
data/lib/readability.rb CHANGED
@@ -47,7 +47,8 @@ module Readability
47
47
  }
48
48
 
49
49
  def content(remove_unlikely_candidates = true)
50
- @html.css("script, style").each { |i| i.remove }
50
+ @html.css("script, style").each {|el| el.remove }
51
+ @html.search('//comment()').each {|el| el.remove }
51
52
 
52
53
  article = youtube if is_youtube? && remove_unlikely_candidates
53
54
  article = vimeo if is_vimeo? && remove_unlikely_candidates
@@ -140,7 +141,7 @@ module Readability
140
141
 
141
142
  sibling_score_threshold = [10, best_candidate[:content_score] * 0.2].max
142
143
  output = Nokogiri::XML::Node.new('div', @html)
143
- best_candidate[:elem].parent.children.each do |sibling|
144
+ best_candidate[:elem].parent.andand.children.each do |sibling|
144
145
  append = false
145
146
  append = true if sibling == best_candidate[:elem]
146
147
  append = true if candidates[sibling] && candidates[sibling][:content_score] >= sibling_score_threshold
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: busk-ruby-readability
3
3
  version: !ruby/object:Gem::Version
4
- hash: 73
4
+ hash: 79
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
9
  - 5
10
- - 1
11
- version: 1.0.5.1
10
+ - 2
11
+ version: 1.0.5.2
12
12
  platform: ruby
13
13
  authors: []
14
14
 
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2010-09-22 00:00:00 -03:00
19
+ date: 2010-10-05 00:00:00 -03:00
20
20
  default_executable:
21
21
  dependencies: []
22
22