escape_escape_escape 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/VERSION +1 -1
  3. data/lib/escape_escape_escape.rb +22 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 82520d557407feddd9e9333ae4965d71fed03a2c
4
- data.tar.gz: dbb1870892902a3b65390c4383f0645ae3c35c84
3
+ metadata.gz: 56c2a260ff14dda105a230c37578df362bef2925
4
+ data.tar.gz: 55285c2ba467f88aaee326e9a3bad7572e4c610e
5
5
  SHA512:
6
- metadata.gz: d33ba7a8cf5309c2885f3af8c733f8877dd89e49dff4f7cf4916891e2350d79ec1a38e236f03640fb329e65bc4bce36aaeac1a1e39d0fd519c1efd3b82275bee
7
- data.tar.gz: 600d997348b4148943725a1220c4de706b8d4eb75ed30d092310b47b8a502d6cbde64b15c00214d9b39db45e401213f6976a7cc7f928eb92fbc163ff2241fbb4
6
+ metadata.gz: 1cfb296f4134a0f1e342b1d9795857a4bb2a2df794717418fee8f77884edd397ade289f4750deafee8fa81e46d11dd5539a59ec3fd18f2f3b43028577bb64fde
7
+ data.tar.gz: 9636b1362c82148ea88e745105ecd7358394c62726a3941d2990133b7d7cc4e2d7273489bc94144c2771d7eebd3579930a65e0453eb29326e42e4362c7740578
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.0
1
+ 0.2.1
@@ -11,6 +11,27 @@ class Escape_Escape_Escape
11
11
  TABS = "\t"
12
12
  CONTROL_CHARS = /[[:cntrl:]\x00-\x1f]/ # Don't use "\x20" because that is the space character.
13
13
  WHITE_SPACE = /[[:space:]]&&[^\n]/ # http://www.rubyinside.com/the-split-is-not-enough-whitespace-shenigans-for-rubyists-5980.html
14
+ CONFIG = {
15
+ :attributes => Sanitize::Config::RELAXED[:attributes].dup,
16
+ :css => Sanitize::Config::RELAXED[:css].dup,
17
+ :allow_doctype => true,
18
+ :elements => %{
19
+ a blockquote body br caption cite code div
20
+ img pre p span
21
+ h1 h2 h3 h4
22
+ i em strong sub sup
23
+ ol li ul
24
+ html title style
25
+ },
26
+ :protocols => {
27
+ "a"=>{
28
+ "href"=>["ftp", "http", "https", "mailto", :relative]
29
+ },
30
+ "img"=>{
31
+ "src"=>["http", "https", :relative]
32
+ }
33
+ }
34
+ }
14
35
 
15
36
  ENCODING_OPTIONS_CLEAN_UTF8 = {
16
37
  :invalid => :replace, # Replace invalid byte sequences
@@ -46,7 +67,7 @@ class Escape_Escape_Escape
46
67
  end
47
68
 
48
69
  def html s
49
- Sanitize.fragment( clean_utf8(s), Sanitize::Config::RELAXED )
70
+ Sanitize.fragment( clean_utf8(s), CONFIG )
50
71
  end
51
72
 
52
73
  end # === class self ===
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: escape_escape_escape
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - da99