render_editorjs 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +2 -2
- data/Gemfile.lock +5 -3
- data/lib/render_editorjs/document.rb +7 -1
- data/lib/render_editorjs/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: 17d71c6a02cdf09a42ce8ccf6afca1c6f1b2012c53bab180495edfd108e8925d
|
|
4
|
+
data.tar.gz: 561a793a12443799619492ecd330d4cd5227ecdba0028134df18d449d0549e74
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0b9b67ff143aac683babff133f6a721b70ce5c74e5b4384a0080a9a234037c2bd3cdd7e3f4288568e1258bb7c0823d50af8a7038a589616063562376d45f0050
|
|
7
|
+
data.tar.gz: e3361768bdc3d0caf6bfa8b42470961e7a51f8fee1162d2ae001f2526b96c9268baf9e54d5bec47eae5d6621d5426db13c5bf97ffc83a3ed2a04c703b7e63791
|
data/.github/workflows/ci.yml
CHANGED
|
@@ -12,8 +12,8 @@ jobs:
|
|
|
12
12
|
strategy:
|
|
13
13
|
fail-fast: false
|
|
14
14
|
matrix:
|
|
15
|
-
ruby: [2.5, 2.6, 2.7, 3.0, head
|
|
16
|
-
continue-on-error: ${{ endsWith(matrix.ruby, 'head')
|
|
15
|
+
ruby: [2.5, 2.6, 2.7, 3.0, head]
|
|
16
|
+
continue-on-error: ${{ endsWith(matrix.ruby, 'head') }}
|
|
17
17
|
steps:
|
|
18
18
|
- uses: actions/checkout@v2
|
|
19
19
|
- name: Set up Ruby
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
render_editorjs (0.1.
|
|
4
|
+
render_editorjs (0.1.2)
|
|
5
5
|
actionview (>= 4)
|
|
6
6
|
json-schema (~> 2)
|
|
7
7
|
sanitize (~> 6.0.0)
|
|
@@ -59,6 +59,7 @@ GEM
|
|
|
59
59
|
nokogiri (>= 1.5.9)
|
|
60
60
|
lumberjack (1.2.8)
|
|
61
61
|
method_source (1.0.0)
|
|
62
|
+
mini_portile2 (2.6.1)
|
|
62
63
|
minitest (5.14.4)
|
|
63
64
|
minitest-focus (1.3.1)
|
|
64
65
|
minitest (>= 4, < 6)
|
|
@@ -70,7 +71,8 @@ GEM
|
|
|
70
71
|
minitest (>= 5.0)
|
|
71
72
|
ruby-progressbar
|
|
72
73
|
nenv (0.3.0)
|
|
73
|
-
nokogiri (1.12.5
|
|
74
|
+
nokogiri (1.12.5)
|
|
75
|
+
mini_portile2 (~> 2.6.1)
|
|
74
76
|
racc (~> 1.4)
|
|
75
77
|
notiffany (0.1.3)
|
|
76
78
|
nenv (~> 0.1)
|
|
@@ -104,7 +106,7 @@ GEM
|
|
|
104
106
|
rubocop-ast (>= 1.12.0, < 2.0)
|
|
105
107
|
ruby-progressbar (~> 1.7)
|
|
106
108
|
unicode-display_width (>= 1.4.0, < 3.0)
|
|
107
|
-
rubocop-ast (1.
|
|
109
|
+
rubocop-ast (1.13.0)
|
|
108
110
|
parser (>= 3.0.1.1)
|
|
109
111
|
rubocop-minitest (0.15.2)
|
|
110
112
|
rubocop (>= 0.90, < 2.0)
|
|
@@ -6,7 +6,7 @@ module RenderEditorjs
|
|
|
6
6
|
|
|
7
7
|
def initialize(content, renderer = RenderEditorjs::DefaultRenderer.new)
|
|
8
8
|
@renderer = renderer
|
|
9
|
-
@content = content.is_a?(Hash) ? content :
|
|
9
|
+
@content = content.is_a?(Hash) ? content : parse_json(content)
|
|
10
10
|
@errors = []
|
|
11
11
|
end
|
|
12
12
|
|
|
@@ -53,5 +53,11 @@ module RenderEditorjs
|
|
|
53
53
|
@block_renderers ||= {}
|
|
54
54
|
@block_renderers[block_type] ||= renderer.mapping[block_type]
|
|
55
55
|
end
|
|
56
|
+
|
|
57
|
+
def parse_json(content)
|
|
58
|
+
JSON.parse(content)
|
|
59
|
+
rescue JSON::ParserError
|
|
60
|
+
nil
|
|
61
|
+
end
|
|
56
62
|
end
|
|
57
63
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: render_editorjs
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- José Galisteo
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2021-11-
|
|
11
|
+
date: 2021-11-09 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: actionview
|