editor_js 0.1.0 → 0.2.0

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: 45e691b09b979e4afd888b80ec43cb81888affd974675ac383a3b87f75284f09
4
- data.tar.gz: 96f7ed2d48805081e9abfd3fd828d90508d59c726301e8cc4b2448ca13758c62
3
+ metadata.gz: f2787f8b3e0e47ff54da6cc6fc80525a8f5432cfbd3ee2525b88f60fe37469ad
4
+ data.tar.gz: 72943f09ae8fe960555554f2d70bace6365d8c796608e845e547004b82619a8e
5
5
  SHA512:
6
- metadata.gz: '09781ff6957c7bcfaed67300b6e2ad5b6deedb98c642ca58a7f3e0b3c1cbee9bcc7a41dcc96760750f649a60f930deeb288328354b840070b7a70ce8eb20b645'
7
- data.tar.gz: 064a72ad6b97626c70c6e2a1767ba493d6c2b0c184de93136f4816dc0129130b2e9985777842772e08e136ef65b3eacb137beb51419ef51786d635fcea5222af
6
+ metadata.gz: 67e53a8f0a64aa6feccb2890415c38fc828c8404ebef8d79d619a1479c07effab7ca367894d34046d1969d39411d7dfce89bac451e0ffd07201a97a94dea701a
7
+ data.tar.gz: 455f764aa8dfaefe85bdabbc991f6fb6d401296f3e849d7e00fc92b744c0a3acdcc76e139a5a5f8ae6b2afc66bd83cd1e735decb52a039aec50224394fd04713
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- editor_js (0.1.0)
4
+ editor_js (0.2.0)
5
5
  actionview (>= 4)
6
6
  activesupport (>= 4)
7
7
  coderay (~> 1.1, >= 1.1.2)
@@ -13,13 +13,13 @@ PATH
13
13
  GEM
14
14
  remote: https://rubygems.org/
15
15
  specs:
16
- actionview (6.0.1)
17
- activesupport (= 6.0.1)
16
+ actionview (6.0.2)
17
+ activesupport (= 6.0.2)
18
18
  builder (~> 3.1)
19
19
  erubi (~> 1.4)
20
20
  rails-dom-testing (~> 2.0)
21
21
  rails-html-sanitizer (~> 1.1, >= 1.2.0)
22
- activesupport (6.0.1)
22
+ activesupport (6.0.2)
23
23
  concurrent-ruby (~> 1.0, >= 1.0.2)
24
24
  i18n (>= 0.7, < 2)
25
25
  minitest (~> 5.1)
@@ -116,4 +116,4 @@ DEPENDENCIES
116
116
  simplecov (~> 0.17.1)
117
117
 
118
118
  BUNDLED WITH
119
- 2.0.2
119
+ 2.1.0
@@ -13,17 +13,13 @@ module EditorJs
13
13
  embed:
14
14
  type: string
15
15
  height:
16
- type:
17
- - number
18
- - string
16
+ type: string
19
17
  service:
20
18
  type: string
21
19
  source:
22
20
  type: string
23
21
  width:
24
- type:
25
- - number
26
- - string
22
+ type: string
27
23
  required:
28
24
  - embed
29
25
  - service
@@ -45,7 +41,7 @@ module EditorJs
45
41
  end
46
42
  end
47
43
 
48
- def sanitize
44
+ def sanitize!
49
45
  %w(caption embed height service source width).each do |key|
50
46
  data[key] = Sanitize.fragment(data[key], remove_contents: true).strip
51
47
  end
@@ -2,22 +2,24 @@
2
2
 
3
3
  module EditorJs
4
4
  module Blocks
5
- class HTMLwithCodeRay < Redcarpet::Render::HTML
6
- def block_code(code, language)
7
- CodeRay.scan(code, language || :text).div(css: :class)
8
- end
5
+ class MarkdownBlock < Base
6
+ class HTMLwithCodeRay < Redcarpet::Render::HTML
7
+ def block_code(code, language)
8
+ CodeRay.scan(code, language || :text).div(css: :class)
9
+ end
9
10
 
10
- def list_item(text, list_type)
11
- if text.start_with?("[x]", "[X]")
12
- text[0..2] = %(<input type='checkbox' checked='checked' disabled>)
13
- elsif text.start_with?("[ ]")
14
- text[0..2] = %(<input type='checkbox' disabled>)
11
+ def list_item(text, list_type)
12
+ if text.start_with?("[x]", "[X]")
13
+ text[0..2] = %(<input type='checkbox' checked='checked' disabled>)
14
+ elsif text.start_with?("[ ]")
15
+ text[0..2] = %(<input type='checkbox' disabled>)
16
+ end
17
+ %(<li>#{text}</li>)
15
18
  end
16
- %(<li>#{text}</li>)
17
19
  end
18
- end
19
20
 
20
- class MarkdownBlock < Base
21
+ def sanitize!; end
22
+
21
23
  def schema
22
24
  YAML.safe_load(<<~YAML)
23
25
  type: object
@@ -1,3 +1,3 @@
1
1
  module EditorJs
2
- VERSION = '0.1.0'
2
+ VERSION = '0.2.0'
3
3
  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.1.0
4
+ version: 0.2.0
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-13 00:00:00.000000000 Z
11
+ date: 2019-12-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionview