html_terminator 2.0.1 → 2.0.2

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: ae2bc36f5c3ad8c93eef68ad14e03bd02a70c293
4
- data.tar.gz: a76bb0d79dfda9e9c9cf188d03d286ddfaa6ea6b
3
+ metadata.gz: bd4d0609098d033eece8510d9bee3dbd0cb09966
4
+ data.tar.gz: 96b86b54353b1b72afe70eac1fbed82257cc2896
5
5
  SHA512:
6
- metadata.gz: 7eb8714c34c2a6555589ef7408fef0bde3649cf0545553c869a38261e50c6dac05eb359fda20a5fd35bafc2141cdcec9357e2e467dd321d034d44ca15d58cd92
7
- data.tar.gz: 5ffe0f501c605ba12032d808f558b2e22eb48ae2679d36c5e42fba803e13c80526c80283a1dd465c3279ef66a7cbb62d9549294ddea3413ab8ed90b6fb142cd6
6
+ metadata.gz: 650230f42f73afa03d5bcf6c37dc76e3cd253a5704a6bef83196a49b49d9847b39141b6f47be404681df422272cbd024f379f0b42595e17bee79eedcf4d55115
7
+ data.tar.gz: 4e0fa09f6dbb339404b9fd2c95d167ede09980151ff8f82c0bd3eb78c1eccc2067a05c256b993efdff4a1bfd513516ea7e323254b5ca31409b9a31931b695ebc
@@ -1,3 +1,3 @@
1
1
  module HtmlTerminator
2
- VERSION = "2.0.1"
2
+ VERSION = "2.0.2"
3
3
  end
@@ -1,6 +1,6 @@
1
1
  require "html_terminator/version"
2
2
  require "html_terminator/extract_options"
3
- require 'sanitize'
3
+ require "sanitize"
4
4
 
5
5
  module HtmlTerminator
6
6
  SANITIZE_OPTIONS = {
@@ -11,7 +11,7 @@ module HtmlTerminator
11
11
  if val.is_a?(String)
12
12
  # Sanitize produces escaped content.
13
13
  # Unescape it to get the raw html
14
- CGI.unescapeHTML Sanitize.fragment(val, config).strip
14
+ CGI.unescapeHTML(Sanitize.fragment(val, config).strip).html_safe
15
15
  else
16
16
  val
17
17
  end
@@ -71,5 +71,10 @@ describe HtmlTerminator do
71
71
  val = HtmlTerminator.sanitize "<flexbox></flexbox><hr><br><img>"
72
72
  val.should == ""
73
73
  end
74
+
75
+ it "marks the output as html_safe" do
76
+ val = HtmlTerminator.sanitize "<flexbox></flexbox><hr><br><img>"
77
+ val.html_safe?.should == true
78
+ end
74
79
  end
75
80
  end
data/spec/spec_helper.rb CHANGED
@@ -1,7 +1,9 @@
1
- require 'rubygems'
2
- require 'bundler/setup'
1
+ require "rubygems"
2
+ require "bundler/setup"
3
3
 
4
4
  $LOAD_PATH.unshift(File.dirname(__FILE__))
5
- $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
5
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), "..", "lib"))
6
6
 
7
- require 'support/active_record'
7
+ require "support/active_record"
8
+ require "active_support"
9
+ require "active_support/core_ext/string/output_safety.rb"
@@ -1,9 +1,9 @@
1
- require 'active_record'
2
- require 'html_terminator'
1
+ require "active_record"
2
+ require "html_terminator"
3
3
 
4
4
  ActiveRecord::Base.establish_connection({
5
- :adapter => 'sqlite3',
6
- :database => ':memory:'
5
+ :adapter => "sqlite3",
6
+ :database => ":memory:"
7
7
  })
8
8
 
9
9
  ActiveRecord::Schema.define do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: html_terminator
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
4
+ version: 2.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steel Fu