onebox 1.7.8 → 1.7.9

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: f4aaa05355640126f6ad6ad266ec44e444f23427
4
- data.tar.gz: 1b3e3acc8b0d5a99fe99d5e09488cee2d2f98f7a
3
+ metadata.gz: 05924ebc8cec392430b6205a27c644d58a988121
4
+ data.tar.gz: 55a81d2164a2b0ba33098ad8a011ee086bfd9397
5
5
  SHA512:
6
- metadata.gz: f287783f7c37eb59b2809170467f52e3104db29afed8e329ac16a60cf73acb1787aafa0dbfee15004b9f4dbca4dca02469d8efda740c8804964c3165f22b7a39
7
- data.tar.gz: df5f79f7d6089ac381c50ca7ea6b39364066f85998c4a8b3dc70a0c61f5e35d162dd0d3ac41f768d8c50f5f9f5b9464383a926bae75fd49ff89e90b90961d059
6
+ metadata.gz: 23ac9657d7da061cc5fa8c990ad18c34dd8693e4067c64aa4c577d83bed2311508b9c08c7c7183337df69c0e709c80ed5c80d5545fb58558e8970f8083d786d2
7
+ data.tar.gz: 333e4e9e2346b939ecc8e4bf0cb4a4cb1145e6cdd4832ef42079a341746431f650a412150d27c34a9f6c7b614edb643439f9d41a6053c7754652bcbcd721baf4
data/lib/onebox.rb CHANGED
@@ -9,6 +9,8 @@ require "cgi"
9
9
  require "net/http"
10
10
  require "digest"
11
11
  require "fast_blank"
12
+ require "sanitize"
13
+ require_relative "onebox/sanitize_config"
12
14
 
13
15
  module Onebox
14
16
  DEFAULTS = {
@@ -19,6 +21,7 @@ module Onebox
19
21
  load_paths: [File.join(Gem::Specification.find_by_name("onebox").gem_dir, "templates")],
20
22
  allowed_ports: [80, 443],
21
23
  allowed_schemes: ["http", "https"],
24
+ sanitize_config: Sanitize::Config::ONEBOX,
22
25
  }
23
26
 
24
27
  @@options = DEFAULTS
@@ -1,6 +1,3 @@
1
- require "sanitize"
2
- require_relative "onebox_sanitize_config"
3
-
4
1
  module Onebox
5
2
  class Preview
6
3
  attr_reader :cache
@@ -64,7 +61,7 @@ module Onebox
64
61
  end
65
62
 
66
63
  def sanitize(html)
67
- Sanitize.fragment(html, Sanitize::Config::ONEBOX)
64
+ Sanitize.fragment(html, @options[:sanitize_config] || Sanitize::Config::ONEBOX)
68
65
  end
69
66
 
70
67
  def engine
@@ -1,3 +1,3 @@
1
1
  module Onebox
2
- VERSION = "1.7.8"
2
+ VERSION = "1.7.9"
3
3
  end
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.7.8
4
+ version: 1.7.9
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-01-27 00:00:00.000000000 Z
13
+ date: 2017-02-06 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: multi_json
@@ -375,8 +375,8 @@ files:
375
375
  - lib/onebox/layout.rb
376
376
  - lib/onebox/layout_support.rb
377
377
  - lib/onebox/matcher.rb
378
- - lib/onebox/onebox_sanitize_config.rb
379
378
  - lib/onebox/preview.rb
379
+ - lib/onebox/sanitize_config.rb
380
380
  - lib/onebox/status_check.rb
381
381
  - lib/onebox/template_support.rb
382
382
  - lib/onebox/version.rb