editor_js 0.3.2 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/editor_js/blocks/header_block.rb +15 -1
- data/lib/editor_js/blocks/paragraph_block.rb +15 -1
- data/lib/editor_js/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 78823d325e66419e62e84adde1e8ec37586db12f9bbfb35482ccb34187dc2799
|
4
|
+
data.tar.gz: 47c8ff8f3a588bb6418e0118bca21f183aecf3802e683078f2b2019b565e42f4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 50a8ba307aa9a078f0e50e8364503c5c917fc429d73d5eebe134e2152493ce55d69e8301fb5c9121ce6a6098d6931372e843f59c564b2e802ef3bda9cb43fa12
|
7
|
+
data.tar.gz: 723fa09aa421e41880ddab811ee431814c9e655ef95ab0dd6fc94a3ebe790d52b1422a6189eb38f41447b743cfce1f96e1d7a27b749fc4af17c33dfcb8d0de0a
|
data/Gemfile.lock
CHANGED
@@ -13,6 +13,12 @@ module EditorJs
|
|
13
13
|
level:
|
14
14
|
type: number
|
15
15
|
enum: [1,2,3,4,5,6]
|
16
|
+
alignment:
|
17
|
+
type: string
|
18
|
+
enum:
|
19
|
+
- align-left
|
20
|
+
- align-center
|
21
|
+
- align-right
|
16
22
|
required:
|
17
23
|
- text
|
18
24
|
- level
|
@@ -20,7 +26,15 @@ module EditorJs
|
|
20
26
|
end
|
21
27
|
|
22
28
|
def render(_options = {})
|
23
|
-
|
29
|
+
alignment = data['alignment']
|
30
|
+
class_name_str = css_name
|
31
|
+
if alignment.present?
|
32
|
+
class_name_str = [
|
33
|
+
class_name_str,
|
34
|
+
css_name("__#{alignment}")
|
35
|
+
].join(' ')
|
36
|
+
end
|
37
|
+
content_tag(:"h#{data['level']}", data['text'].html_safe, class: class_name_str)
|
24
38
|
end
|
25
39
|
|
26
40
|
def sanitize!
|
@@ -10,11 +10,25 @@ module EditorJs
|
|
10
10
|
properties:
|
11
11
|
text:
|
12
12
|
type: string
|
13
|
+
alignment:
|
14
|
+
type: string
|
15
|
+
enum:
|
16
|
+
- align-left
|
17
|
+
- align-center
|
18
|
+
- align-right
|
13
19
|
YAML
|
14
20
|
end
|
15
21
|
|
16
22
|
def render(_options = {})
|
17
|
-
|
23
|
+
alignment = data['alignment']
|
24
|
+
class_name_str = css_name
|
25
|
+
if alignment.present?
|
26
|
+
class_name_str = [
|
27
|
+
class_name_str,
|
28
|
+
css_name("__#{alignment}")
|
29
|
+
].join(' ')
|
30
|
+
end
|
31
|
+
content_tag(:div, class: class_name_str) { data['text'].html_safe }
|
18
32
|
end
|
19
33
|
|
20
34
|
def sanitize!
|
data/lib/editor_js/version.rb
CHANGED
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.3.
|
4
|
+
version: 0.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- xiaohui
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-07-
|
11
|
+
date: 2020-07-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionview
|