busk-ruby-readability 1.2.4 → 1.2.5

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.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- busk-ruby-readability (1.2.3)
4
+ busk-ruby-readability (1.2.4)
5
5
 
6
6
  GEM
7
7
  remote: http://rubygems.org/
data/lib/readability.rb CHANGED
@@ -58,7 +58,11 @@ module Readability
58
58
  article = apply_custom_rule if has_special_rule?
59
59
 
60
60
  if article && remove_unlikely_candidates
61
- return article.to_html.gsub(/[\r\n\f]+/, "\n" ).gsub(/[\t ]+/, " ").gsub(/ /, " ")
61
+ content = article.to_html.gsub(/[\r\n\f]+/, "\n" ).gsub(/[\t ]+/, " ").gsub(/ /, " ")
62
+ if rules[@base_uri].try(:encoding) && rules[@base_uri].encoding == 'ISO-8859-1'
63
+ return convert_to_utf8(content)
64
+ end
65
+ return content
62
66
  else
63
67
  remove_unlikely_candidates! if remove_unlikely_candidates
64
68
  transform_misused_divs_into_paragraphs!
@@ -2,7 +2,7 @@ Gem::Specification.new do |s|
2
2
  s.authors = ["Fabio Mont Alegre", "Rodrigo Flores"]
3
3
  s.email = "it-team@busk.com"
4
4
  s.homepage = "http://github.com/busk/ruby-readability"
5
- s.version = "1.2.4"
5
+ s.version = "1.2.5"
6
6
  s.name = "busk-ruby-readability"
7
7
  s.summary = "A rewrite of original ruby-readability"
8
8
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: busk-ruby-readability
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 2
9
- - 4
10
- version: 1.2.4
9
+ - 5
10
+ version: 1.2.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - Fabio Mont Alegre