onebox 1.8.31 → 1.8.32

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e1693aa62d3780f323374bbaf5eecdc31028ca85
4
- data.tar.gz: b376ca6245c835e2b312a5632b5b3c83a2fafab6
3
+ metadata.gz: 3e49ab7f828cf41a7445feb4526258d894765d98
4
+ data.tar.gz: dad7b82956c8e34edb9963190494ceab97af2e43
5
5
  SHA512:
6
- metadata.gz: fc6d88b56b3ff3f7458c1174a4021e8fd89e29de91138296e5401e644f6b4685440456b8251e4f409d090894437d64a289b166081b498e15b7639e4706b1a072
7
- data.tar.gz: 703e0d7ef41e832e169f672202db94154095b17c45cedf78559bc03786702eb6da61295ebb9cf5ba2d71680c5f16212f50eb7268925d8446734e10e592baa6c7
6
+ metadata.gz: 24510f07b4ed9ae577c9201722409ea956c1de9d835c6cf06ee4958303c91a41d1e1dfc072cc8ba8930683aea34a43f416fcdbb759a19b2f0c28ec34f6483081
7
+ data.tar.gz: c268644571d29f8ab3f2df61db3a7fc1c33e99a52caead8fc25b895debf7c8871e3d4de42f7844f953145e032537aa75d2e9d27e026f6ada29355267104ac05a
@@ -122,9 +122,12 @@ module Onebox
122
122
  favicon = html_doc.css('link[rel="shortcut icon"], link[rel="icon shortcut"], link[rel="shortcut"], link[rel="icon"]').first
123
123
  favicon = favicon.nil? ? nil : (favicon['href'].nil? ? nil : favicon['href'].strip)
124
124
 
125
- if favicon && favicon.match(/^https?:\/\//i).nil?
125
+ if favicon && !!(favicon =~ /^\/\//)
126
126
  uri = URI(url)
127
- favicon = uri.scheme + "://" + uri.host.sub(/\/$/, "") + "/" + favicon.sub(/^\//, "")
127
+ favicon = "#{uri.scheme}:#{favicon}"
128
+ elsif favicon && favicon.match(/^https?:\/\//i).nil?
129
+ uri = URI(url)
130
+ favicon = "#{uri.scheme}://#{uri.host.sub(/\/$/, '')}/#{favicon.sub(/^\//, '')}"
128
131
  end
129
132
 
130
133
  favicon
@@ -1,3 +1,3 @@
1
1
  module Onebox
2
- VERSION = "1.8.31"
2
+ VERSION = "1.8.32"
3
3
  end
@@ -1,4 +1,4 @@
1
- <img src="{{image}}" class="thumbnail"/>
1
+ {{#image}}<img src="{{image}}" class="thumbnail"/>{{/image}}
2
2
 
3
3
  <h3><a href='{{link}}' target='_blank'>{{title}}</a></h3>
4
4
  {{#by_info}}<b>{{by_info}}</b>{{/by_info}}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: onebox
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.31
4
+ version: 1.8.32
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joanna Zeta
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2017-12-21 00:00:00.000000000 Z
13
+ date: 2017-12-22 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: multi_json