editor_js 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +4 -4
- data/lib/editor_js/blocks/checklist_block.rb +7 -3
- data/lib/editor_js/document.rb +5 -1
- data/lib/editor_js/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e86cd6d867f3751fae7644a529b9a81940189acff184a7a9d57c835603c1a10c
|
4
|
+
data.tar.gz: e8650afadb86745553ae949f67b26766e866d4213f4f2da49a1fb3b8a27b6f8d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 39595b63e56f1f8d68ef2ca9ab3b83daf5539c87a88a5456f278444739c0705b8bb2ce3290f284e0ed13f84271c47ee0b0a851e8004be3d36082395017b0fefd
|
7
|
+
data.tar.gz: 70d3d7bfb418837f95d1e8140197a68daf1a2225e7fa1076f164991d6698decfcf83d515ff3dc280e2304141674ede9cf9cf3f70affa995511a64d64cc8801d8
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
editor_js (0.2.
|
4
|
+
editor_js (0.2.2)
|
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.2)
|
17
|
-
activesupport (= 6.0.2)
|
16
|
+
actionview (6.0.2.1)
|
17
|
+
activesupport (= 6.0.2.1)
|
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.2)
|
22
|
+
activesupport (6.0.2.1)
|
23
23
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
24
24
|
i18n (>= 0.7, < 2)
|
25
25
|
minitest (~> 5.1)
|
@@ -25,9 +25,13 @@ module EditorJs
|
|
25
25
|
|
26
26
|
def render(_options = {})
|
27
27
|
content_tag :div, class: css_name do
|
28
|
-
data['items'].
|
29
|
-
|
30
|
-
|
28
|
+
data['items'].map do |item|
|
29
|
+
content_tag(:div, class: css_name('__warrper')) do
|
30
|
+
html_str = content_tag(:input, nil, type: 'checkbox', disabled: true, checked: item['checked'])
|
31
|
+
html_str += content_tag(:label, item['text'])
|
32
|
+
html_str.html_safe
|
33
|
+
end.html_safe
|
34
|
+
end.join.html_safe
|
31
35
|
end
|
32
36
|
end
|
33
37
|
|
data/lib/editor_js/document.rb
CHANGED
@@ -15,6 +15,10 @@ module EditorJs
|
|
15
15
|
type: object
|
16
16
|
version:
|
17
17
|
type: string
|
18
|
+
required:
|
19
|
+
- time
|
20
|
+
- blocks
|
21
|
+
- version
|
18
22
|
YAML
|
19
23
|
|
20
24
|
def initialize(str_or_hash)
|
@@ -40,7 +44,7 @@ module EditorJs
|
|
40
44
|
def render
|
41
45
|
return @renderred_html if instance_variable_defined?(:@renderred_html)
|
42
46
|
|
43
|
-
@renderred_html = valid? ? @blocks.map(&:render).join : ''
|
47
|
+
@renderred_html = valid? ? @blocks.map(&:render).join.html_safe : ''
|
44
48
|
end
|
45
49
|
|
46
50
|
def plain
|
data/lib/editor_js/version.rb
CHANGED