editor_js 0.2.2 → 0.2.3

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
  SHA256:
3
- metadata.gz: e86cd6d867f3751fae7644a529b9a81940189acff184a7a9d57c835603c1a10c
4
- data.tar.gz: e8650afadb86745553ae949f67b26766e866d4213f4f2da49a1fb3b8a27b6f8d
3
+ metadata.gz: 77738c455a6cc79eb1b2a20874baf3577f55c327ad9eb6447f6f494a175ad0ef
4
+ data.tar.gz: '093553c9c3ef1847fd251f8c005b2598acea27104d29d1e5075eddf0af171dd1'
5
5
  SHA512:
6
- metadata.gz: 39595b63e56f1f8d68ef2ca9ab3b83daf5539c87a88a5456f278444739c0705b8bb2ce3290f284e0ed13f84271c47ee0b0a851e8004be3d36082395017b0fefd
7
- data.tar.gz: 70d3d7bfb418837f95d1e8140197a68daf1a2225e7fa1076f164991d6698decfcf83d515ff3dc280e2304141674ede9cf9cf3f70affa995511a64d64cc8801d8
6
+ metadata.gz: 97e69bbab2ec94c7055f0905bed3f5a0d7160f9a0da8cabfcfce4ff511fc04bd3553702e795b9d7b606f4418e1099638497a10c7becf6cba9cc81b54deb9b2dd
7
+ data.tar.gz: 21aea8e610a98441b4c59096139b138131f6b310634353227ffa299d0c20ea1e6f3902d5c997b67e06777648ee63119cef43f85cb8b3be67499a1a5bba58e68b
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- editor_js (0.2.2)
4
+ editor_js (0.2.3)
5
5
  actionview (>= 4)
6
6
  activesupport (>= 4)
7
7
  coderay (~> 1.1, >= 1.1.2)
@@ -98,7 +98,7 @@ GEM
98
98
  simplecov-html (~> 0.10.0)
99
99
  simplecov-html (0.10.2)
100
100
  thread_safe (0.3.6)
101
- tzinfo (1.2.5)
101
+ tzinfo (1.2.6)
102
102
  thread_safe (~> 0.1)
103
103
  unicode-display_width (1.6.0)
104
104
  zeitwerk (2.2.2)
@@ -42,8 +42,12 @@ module EditorJs
42
42
  end
43
43
 
44
44
  def sanitize!
45
- %w(caption embed height service source width).each do |key|
46
- data[key] = Sanitize.fragment(data[key], remove_contents: true).strip
45
+ %w[caption embed height service source width].each do |key|
46
+ str = Sanitize.fragment(data[key], remove_contents: true).strip
47
+ if %w[embed service source].include?(key)
48
+ str.gsub('&', '&')
49
+ end
50
+ data[key] = str
47
51
  end
48
52
  end
49
53
 
@@ -44,7 +44,13 @@ module EditorJs
44
44
  end
45
45
 
46
46
  def sanitize!
47
- data['caption'] = Sanitize.fragment(data['caption'], remove_contents: true)
47
+ %w[caption url].each do |key|
48
+ str = Sanitize.fragment(data[key], remove_contents: true).strip
49
+ if key == 'url'
50
+ str.gsub('&', '&')
51
+ end
52
+ data[key] = str
53
+ end
48
54
  end
49
55
 
50
56
  def plain
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EditorJs
4
- VERSION = '0.2.2'
4
+ VERSION = '0.2.3'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: editor_js
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - xiaohui
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-12-19 00:00:00.000000000 Z
11
+ date: 2020-01-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionview