readability-rb 0.6.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c451d1e4e2e12c168b323f813a36594c25177e7a8fa4c1999cd55fd652128413
4
- data.tar.gz: be5c5fe5aef9cc1186c25112f6e3ca11220aec7b4cb122682092fe3db14c4008
3
+ metadata.gz: 9face7faf604c0ce94f2ad0db7bd6537bb0b46ec34703e8d8711f67e11249071
4
+ data.tar.gz: 8ce547233f221524924bf3678eecee1b9da566d16ac025586050a480693f6861
5
5
  SHA512:
6
- metadata.gz: 210bd7531212e4c9ad91ec6da99e3bd0a74eb1dd62040b646bc7e90a07daadc13e19c9681d2bd6c7e2412c2ef3f30752671b52472f22b26fbc263eaf2f473e64
7
- data.tar.gz: 692bcc0189b89d1b440d7a5bf0cf4bd53a313ef30cebab92ca93d2c6f6d88a81fb531d1cabe85c07487748467e17a1e591b6f32237b5f01ed89eb14f7f5ea329
6
+ metadata.gz: f90592e96640dee76abced9686165b9bb3d20254df78c157c70108929234c3bfd5bc2049472263c5e7ce32fac07627402beb64a1f1bca46510a15c0b146f07c5
7
+ data.tar.gz: 6b79072fb4874ec9881cce4c3b44dd90880fb3fb31a7b9c20b0130db658ac7a806f2c29d1113e4484d25ef7776eede73809edf37f3467d18e58361b0d95c67b4
@@ -449,7 +449,7 @@ module Readability
449
449
 
450
450
  inner_text = get_inner_text(node)
451
451
 
452
- if inner_text.split(COMMAS).length - 1 < 10
452
+ if inner_text.count(",") < 10
453
453
  tag_counts = Hash.new(0)
454
454
  node.css("p, img, li, input").each { |n| tag_counts[n.name] += 1 }
455
455
  p_count = tag_counts["p"]
@@ -290,7 +290,7 @@ module Readability
290
290
  content_score += 1
291
291
 
292
292
  # Add points for any commas within this paragraph.
293
- content_score += inner_text.split(COMMAS).length
293
+ content_score += inner_text.split(COMMAS, -1).length
294
294
 
295
295
  # For every 100 characters in this paragraph, add another point. Up to 3 points.
296
296
  content_score += [inner_text.length / 100, 3].min
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Readability
4
- VERSION = "0.6.0"
4
+ VERSION = "0.7.0"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: readability-rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Croll