render_editorjs 0.1.0 → 0.1.1

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: 274bd17658519354f9866dd387af98455776a5d42258857c844de742057e1019
4
- data.tar.gz: 6f4462f4d9764b71f858dc713a742d6f8032cb1362e7cda0e5c465a6552d136f
3
+ metadata.gz: afb48f475a907b32008641ef5749b4ac35ba8633296a883e309dd29a2ecd2632
4
+ data.tar.gz: 960fd6d51523abef86d19cf4bbdbcf95df905b087d45de6f493369e30877120d
5
5
  SHA512:
6
- metadata.gz: c87569afce1612068cd26ddf2327564e2a3432a67e93782553fddadfd8f8f4049c024a4f1c73a0aa9a68bb6f2e555805a1cdcabdce527b4fc204b6a79a109db6
7
- data.tar.gz: fee46c4f509bee06340574356a01a5161282771dad9117243f6e4a763932de65779ee92386a721517cf0b1117ad104e7bfc17fa68d76da5d13f26a58b2541b3e
6
+ metadata.gz: d5661597c851c45d391fbd2b01fb4d7d6eeade720645b43f5b080ed6af9eecad81e7838e6785e736476f2e47557562b2dee77f868fc5b7f53205619be9c2704e
7
+ data.tar.gz: aab631479c0c87892a943fe14145db11e80e821756765838aa3661b746f0d302556942eabe310ba590545e5590497b4e849918017f9b4139c87a8369bda83e96
@@ -0,0 +1,37 @@
1
+ name: RuboCop
2
+
3
+ on:
4
+ push:
5
+ branches: [ master ]
6
+ pull_request:
7
+ branches: [ master ]
8
+
9
+ jobs:
10
+ build:
11
+ runs-on: ubuntu-latest
12
+ strategy:
13
+ fail-fast: false
14
+ matrix:
15
+ ruby: [2.5, 2.6, 2.7, 3.0, head, debug, truffleruby, truffleruby-head ] # jruby and jruby-head fails due nokogiri
16
+ continue-on-error: ${{ endsWith(matrix.ruby, 'head') || matrix.ruby == 'debug' }}
17
+ steps:
18
+ - uses: actions/checkout@v2
19
+ - name: Set up Ruby
20
+ uses: ruby/setup-ruby@v1
21
+ with:
22
+ ruby-version: ${{ matrix.ruby }}
23
+ - name: Cache gems
24
+ uses: actions/cache@v1
25
+ with:
26
+ path: vendor/bundle
27
+ key: ${{ runner.os }}-rubocop-${{ hashFiles('**/Gemfile.lock') }}
28
+ restore-keys: |
29
+ ${{ runner.os }}-rubocop-
30
+ - name: Install gems
31
+ run: |
32
+ bundle config path vendor/bundle
33
+ bundle install --jobs 4 --retry 3
34
+ - name: Run tests
35
+ run: bundle exec rake test
36
+ - name: Run RuboCop
37
+ run: bundle exec rubocop --parallel
@@ -0,0 +1,70 @@
1
+ # For most projects, this workflow file will not need changing; you simply need
2
+ # to commit it to your repository.
3
+ #
4
+ # You may wish to alter this file to override the set of languages analyzed,
5
+ # or to provide custom queries or build logic.
6
+ #
7
+ # ******** NOTE ********
8
+ # We have attempted to detect the languages in your repository. Please check
9
+ # the `language` matrix defined below to confirm you have the correct set of
10
+ # supported CodeQL languages.
11
+ #
12
+ name: "CodeQL"
13
+
14
+ on:
15
+ push:
16
+ branches: [ master ]
17
+ pull_request:
18
+ # The branches below must be a subset of the branches above
19
+ branches: [ master ]
20
+ schedule:
21
+ - cron: '27 16 * * 2'
22
+
23
+ jobs:
24
+ analyze:
25
+ name: Analyze
26
+ runs-on: ubuntu-latest
27
+ permissions:
28
+ actions: read
29
+ contents: read
30
+ security-events: write
31
+
32
+ strategy:
33
+ fail-fast: false
34
+ matrix:
35
+ language: [ 'ruby' ]
36
+ # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
37
+ # Learn more about CodeQL language support at https://git.io/codeql-language-support
38
+
39
+ steps:
40
+ - name: Checkout repository
41
+ uses: actions/checkout@v2
42
+
43
+ # Initializes the CodeQL tools for scanning.
44
+ - name: Initialize CodeQL
45
+ uses: github/codeql-action/init@v1
46
+ with:
47
+ languages: ${{ matrix.language }}
48
+ # If you wish to specify custom queries, you can do so here or in a config file.
49
+ # By default, queries listed here will override any specified in a config file.
50
+ # Prefix the list here with "+" to use these queries and those in the config file.
51
+ # queries: ./path/to/local/query, your-org/your-repo/queries@main
52
+
53
+ # Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
54
+ # If this step fails, then you should remove it and run the build manually (see below)
55
+ - name: Autobuild
56
+ uses: github/codeql-action/autobuild@v1
57
+
58
+ # ℹ️ Command-line programs to run using the OS shell.
59
+ # 📚 https://git.io/JvXDl
60
+
61
+ # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
62
+ # and modify them (or add more) to build your code if your project
63
+ # uses a compiled language
64
+
65
+ #- run: |
66
+ # make bootstrap
67
+ # make release
68
+
69
+ - name: Perform CodeQL Analysis
70
+ uses: github/codeql-action/analyze@v1
data/.rubocop.yml CHANGED
@@ -26,6 +26,9 @@ Metrics/MethodLength:
26
26
  Metrics/AbcSize:
27
27
  Enabled: false
28
28
 
29
+ Minitest/MultipleAssertions:
30
+ Enabled: false
31
+
29
32
  Style/Documentation:
30
33
  Enabled: false
31
34
 
data/Gemfile CHANGED
@@ -5,11 +5,15 @@ source "https://rubygems.org"
5
5
  # Specify your gem's dependencies in render_editorjs.gemspec
6
6
  gemspec
7
7
 
8
+ gem "guard"
9
+ gem "guard-minitest"
8
10
  gem "minitest", "~> 5.0"
9
11
  gem "minitest-focus"
12
+ gem "minitest-line"
10
13
  gem "minitest-reporters"
11
14
  gem "rake", "~> 12.0"
12
15
  gem "rubocop", "~> 1.22", require: false
13
16
  gem "rubocop-minitest", require: false
14
17
  gem "rubocop-performance", require: false
15
18
  gem "rubocop-thread_safety", require: false
19
+ gem "simplecov", require: false
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- render_editorjs (0.1.0)
4
+ render_editorjs (0.1.1)
5
5
  actionview (>= 4)
6
6
  json-schema (~> 2)
7
7
  sanitize (~> 6.0.0)
@@ -27,31 +27,60 @@ GEM
27
27
  ansi (1.5.0)
28
28
  ast (2.4.2)
29
29
  builder (3.2.4)
30
+ coderay (1.1.3)
30
31
  concurrent-ruby (1.1.9)
31
32
  crass (1.0.6)
33
+ docile (1.4.0)
32
34
  erubi (1.10.0)
35
+ ffi (1.15.4)
36
+ formatador (0.3.0)
37
+ guard (2.18.0)
38
+ formatador (>= 0.2.4)
39
+ listen (>= 2.7, < 4.0)
40
+ lumberjack (>= 1.0.12, < 2.0)
41
+ nenv (~> 0.1)
42
+ notiffany (~> 0.0)
43
+ pry (>= 0.13.0)
44
+ shellany (~> 0.0)
45
+ thor (>= 0.18.1)
46
+ guard-compat (1.2.1)
47
+ guard-minitest (2.4.6)
48
+ guard-compat (~> 1.2)
49
+ minitest (>= 3.0)
33
50
  i18n (1.8.11)
34
51
  concurrent-ruby (~> 1.0)
35
52
  json-schema (2.8.1)
36
53
  addressable (>= 2.4)
54
+ listen (3.7.0)
55
+ rb-fsevent (~> 0.10, >= 0.10.3)
56
+ rb-inotify (~> 0.9, >= 0.9.10)
37
57
  loofah (2.12.0)
38
58
  crass (~> 1.0.2)
39
59
  nokogiri (>= 1.5.9)
40
- mini_portile2 (2.6.1)
60
+ lumberjack (1.2.8)
61
+ method_source (1.0.0)
41
62
  minitest (5.14.4)
42
63
  minitest-focus (1.3.1)
43
64
  minitest (>= 4, < 6)
65
+ minitest-line (0.6.5)
66
+ minitest (~> 5.0)
44
67
  minitest-reporters (1.4.3)
45
68
  ansi
46
69
  builder
47
70
  minitest (>= 5.0)
48
71
  ruby-progressbar
49
- nokogiri (1.12.5)
50
- mini_portile2 (~> 2.6.1)
72
+ nenv (0.3.0)
73
+ nokogiri (1.12.5-x86_64-darwin)
51
74
  racc (~> 1.4)
75
+ notiffany (0.1.3)
76
+ nenv (~> 0.1)
77
+ shellany (~> 0.0)
52
78
  parallel (1.21.0)
53
79
  parser (3.0.2.0)
54
80
  ast (~> 2.4.1)
81
+ pry (0.14.1)
82
+ coderay (~> 1.1)
83
+ method_source (~> 1.0)
55
84
  public_suffix (4.0.6)
56
85
  racc (1.6.0)
57
86
  rails-dom-testing (2.0.3)
@@ -61,6 +90,9 @@ GEM
61
90
  loofah (~> 2.3)
62
91
  rainbow (3.0.0)
63
92
  rake (12.3.3)
93
+ rb-fsevent (0.11.0)
94
+ rb-inotify (0.10.1)
95
+ ffi (~> 1.0)
64
96
  regexp_parser (2.1.1)
65
97
  rexml (3.2.5)
66
98
  rubocop (1.22.3)
@@ -85,6 +117,14 @@ GEM
85
117
  sanitize (6.0.0)
86
118
  crass (~> 1.0.2)
87
119
  nokogiri (>= 1.12.0)
120
+ shellany (0.0.1)
121
+ simplecov (0.21.2)
122
+ docile (~> 1.1)
123
+ simplecov-html (~> 0.11)
124
+ simplecov_json_formatter (~> 0.1)
125
+ simplecov-html (0.12.3)
126
+ simplecov_json_formatter (0.1.3)
127
+ thor (1.1.0)
88
128
  tzinfo (2.0.4)
89
129
  concurrent-ruby (~> 1.0)
90
130
  unicode-display_width (2.1.0)
@@ -94,8 +134,11 @@ PLATFORMS
94
134
  ruby
95
135
 
96
136
  DEPENDENCIES
137
+ guard
138
+ guard-minitest
97
139
  minitest (~> 5.0)
98
140
  minitest-focus
141
+ minitest-line
99
142
  minitest-reporters
100
143
  rake (~> 12.0)
101
144
  render_editorjs!
@@ -103,6 +146,7 @@ DEPENDENCIES
103
146
  rubocop-minitest
104
147
  rubocop-performance
105
148
  rubocop-thread_safety
149
+ simplecov
106
150
 
107
151
  BUNDLED WITH
108
152
  2.1.4
data/Guardfile ADDED
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ guard :minitest do
4
+ # with Minitest::Unit
5
+ watch(%r{^test/(.*)/?(.*)_test\.rb$})
6
+ watch(%r{^lib/(.*/)?([^/]+)\.rb$}) { |m| "test/#{m[1]}#{m[2]}_test.rb" }
7
+ watch(%r{^lib/(.*/)?([^/]+)\.rb$}) { |m| "test/#{m[2]}_test.rb" }
8
+ watch(%r{^test/test_helper\.rb$}) { "test" }
9
+ end
data/README.md CHANGED
@@ -41,7 +41,7 @@ RenderEditorjs.render(json) #=> HTML...
41
41
 
42
42
  ```ruby
43
43
  renderer = RenderEditorjs::DefaultRenderer.new
44
- document = RenderEditorjs::Document.new(renderer, json)
44
+ document = RenderEditorjs::Document.new(json, renderer)
45
45
 
46
46
  document.valid? #=> true | false
47
47
  document.errors #=> Array with the schema errors
@@ -54,7 +54,7 @@ Customize the DefaultRenderer adding or overriding blocks:
54
54
 
55
55
  ```ruby
56
56
  renderer = RenderEditorjs::DefaultRenderer.new("header" => MyCustomHeader.new, "customBlock" => CustomBlock.new)
57
- document = RenderEditorjs::Document.new(renderer, json)
57
+ document = RenderEditorjs::Document.new(json, renderer)
58
58
  document.render #=> My custom HTML
59
59
  ```
60
60
 
@@ -62,7 +62,7 @@ Create your renderer class:
62
62
 
63
63
  ```ruby
64
64
  renderer = MyOwnRenderer.new
65
- document = RenderEditorjs::Document.new(renderer, json)
65
+ document = RenderEditorjs::Document.new(json, renderer)
66
66
  document.render #=> My custom HTML
67
67
  ```
68
68
 
@@ -74,7 +74,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
74
74
 
75
75
  ## Contributing
76
76
 
77
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/editorjs. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/editorjs/blob/master/CODE_OF_CONDUCT.md).
77
+ Bug reports and pull requests are welcome on GitHub at https://github.com/ceritium/render_editorjs. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/ceritium/render_editorjs/blob/master/CODE_OF_CONDUCT.md).
78
78
 
79
79
 
80
80
  ## License
@@ -83,4 +83,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
83
83
 
84
84
  ## Code of Conduct
85
85
 
86
- Everyone interacting in the Editorjs project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/editorjs/blob/master/CODE_OF_CONDUCT.md).
86
+ Everyone interacting in the RenderEditorjs project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/ceritium/render_editorjs/blob/master/CODE_OF_CONDUCT.md).
@@ -2,11 +2,8 @@
2
2
 
3
3
  module RenderEditorjs
4
4
  module Blocks
5
+ # Compatible with https://github.com/editor-js/header
5
6
  class Header < Base
6
- DEFAULT_OPTIONS = {
7
- alignment: "align-left"
8
- }.freeze
9
-
10
7
  SCHEMA = YAML.safe_load(<<~YAML)
11
8
  type: object
12
9
  additionalProperties: false
@@ -19,9 +16,9 @@ module RenderEditorjs
19
16
  alignment:
20
17
  type: string
21
18
  enum:
22
- - align-left
23
- - align-center
24
- - align-right
19
+ - left
20
+ - center
21
+ - right
25
22
  required:
26
23
  - text
27
24
  - level
@@ -31,15 +28,8 @@ module RenderEditorjs
31
28
  return unless valid?(data)
32
29
 
33
30
  alignment = data["alignment"]
34
- class_name = ""
35
- if alignment.present?
36
- class_name = [
37
- class_name,
38
- css_name("__#{alignment}")
39
- ].join(" ")
40
- end
41
-
42
- content_tag(:"h#{data["level"]}", sanitize(data["text"]).html_safe, class: class_name.presence)
31
+ css_class = alignment ? "align-#{alignment}" : nil
32
+ content_tag(:"h#{data["level"]}", sanitize(data["text"]).html_safe, class: css_class)
43
33
  end
44
34
 
45
35
  def sanitize(text)
@@ -4,8 +4,6 @@ module RenderEditorjs
4
4
  module Blocks
5
5
  # Render for https://github.com/editor-js/image
6
6
  class Image < Base
7
- DEFAULT_OPTIONS = {}.freeze
8
-
9
7
  SCHEMA = YAML.safe_load(<<~YAML)
10
8
  type: object
11
9
  additionalProperties: false
@@ -32,9 +30,8 @@ module RenderEditorjs
32
30
  def render(data)
33
31
  return unless valid?(data)
34
32
 
35
- data = sanitize(data)
36
- url = data["file"]["url"]
37
- caption = data["caption"]
33
+ url = sanitize_url(data["file"]["url"])
34
+ caption = sanitize_caption(data["caption"])
38
35
  with_border = data["withBorder"]
39
36
  with_background = data["withBackground"]
40
37
  stretched = data["stretched"]
@@ -47,7 +44,8 @@ module RenderEditorjs
47
44
  html_str = content_tag :div, class: html_class do
48
45
  content_tag :img, "", src: url
49
46
  end
50
- html_str << content_tag(:div, caption.html_safe, class: "caption").html_safe
47
+ html_str << content_tag(:div, caption.html_safe, class: "caption").html_safe if caption.presence
48
+ html_str
51
49
  end
52
50
 
53
51
  def sanitize(data)
@@ -59,6 +57,14 @@ module RenderEditorjs
59
57
 
60
58
  data
61
59
  end
60
+
61
+ def sanitize_url(url)
62
+ Sanitize.fragment(url, remove_contents: true).strip.gsub("&amp;", "&")
63
+ end
64
+
65
+ def sanitize_caption(caption)
66
+ Sanitize.fragment(caption, remove_contents: true).strip
67
+ end
62
68
  end
63
69
  end
64
70
  end
@@ -4,6 +4,18 @@ module RenderEditorjs
4
4
  module Blocks
5
5
  # Render for https://github.com/editor-js/nested-list
6
6
  class List < Base
7
+ # TODO: Consider extract it and the sanitize method with the other on
8
+ # Paragraph block to the DefaultRenderer
9
+ SAFE_TAGS = {
10
+ "b" => nil,
11
+ "i" => nil,
12
+ "u" => ["class"],
13
+ "del" => ["class"],
14
+ "a" => ["href"],
15
+ "mark" => ["class"],
16
+ "code" => ["class"]
17
+ }.freeze
18
+
7
19
  SCHEMA = YAML.safe_load(<<~YAML)
8
20
  type: object
9
21
  additionalProperties: false
@@ -46,23 +58,11 @@ module RenderEditorjs
46
58
  end
47
59
  end
48
60
 
49
- def safe_tags
50
- {
51
- "b" => nil,
52
- "i" => nil,
53
- "u" => ["class"],
54
- "del" => ["class"],
55
- "a" => ["href"],
56
- "mark" => ["class"],
57
- "code" => ["class"]
58
- }
59
- end
60
-
61
61
  def sanitize(text)
62
62
  Sanitize.fragment(
63
63
  text,
64
- elements: safe_tags.keys,
65
- attributes: safe_tags.select { |_k, v| v },
64
+ elements: SAFE_TAGS.keys,
65
+ attributes: SAFE_TAGS.select { |_k, v| v },
66
66
  remove_contents: true
67
67
  )
68
68
  end
@@ -2,11 +2,23 @@
2
2
 
3
3
  module RenderEditorjs
4
4
  module Blocks
5
+ # Compatible with default Paragraph and paragraph-with-aligment
6
+ # https://github.com/kaaaaaaaaaaai/paragraph-with-alignment
5
7
  class Paragraph < Base
6
8
  DEFAULT_OPTIONS = {
7
9
  tag: "p"
8
10
  }.freeze
9
11
 
12
+ SAFE_TAGS = {
13
+ "b" => nil,
14
+ "i" => nil,
15
+ "u" => ["class"],
16
+ "del" => ["class"],
17
+ "a" => ["href"],
18
+ "mark" => ["class"],
19
+ "code" => ["class"]
20
+ }.freeze
21
+
10
22
  SCHEMA = YAML.safe_load(<<~YAML)
11
23
  type: object
12
24
  additionalProperties: false
@@ -16,9 +28,9 @@ module RenderEditorjs
16
28
  alignment:
17
29
  type: string
18
30
  enum:
19
- - align-left
20
- - align-center
21
- - align-right
31
+ - left
32
+ - center
33
+ - right
22
34
  YAML
23
35
 
24
36
  attr_reader :options
@@ -32,36 +44,17 @@ module RenderEditorjs
32
44
  return unless valid?(data)
33
45
 
34
46
  alignment = data["alignment"]
35
- class_name_str = ""
36
- if alignment.present?
37
- class_name_str = [
38
- class_name_str,
39
- css_name("__#{alignment}")
40
- ].join(" ")
41
- end
42
-
43
- content_tag(options[:tag], class: class_name_str.presence) do
47
+ css_class = alignment ? "align-#{alignment}" : nil
48
+ content_tag(options[:tag], class: css_class) do
44
49
  sanitize(data["text"]).html_safe
45
50
  end
46
51
  end
47
52
 
48
- def safe_tags
49
- {
50
- "b" => nil,
51
- "i" => nil,
52
- "u" => ["class"],
53
- "del" => ["class"],
54
- "a" => ["href"],
55
- "mark" => ["class"],
56
- "code" => ["class"]
57
- }
58
- end
59
-
60
53
  def sanitize(text)
61
54
  Sanitize.fragment(
62
55
  text,
63
- elements: safe_tags.keys,
64
- attributes: safe_tags.select { |_k, v| v },
56
+ elements: SAFE_TAGS.keys,
57
+ attributes: SAFE_TAGS.select { |_k, v| v },
65
58
  remove_contents: true
66
59
  )
67
60
  end
@@ -33,5 +33,9 @@ module RenderEditorjs
33
33
  def initialize(custom_mapping = {})
34
34
  @mapping = DEFAULT_MAPPING.merge(custom_mapping)
35
35
  end
36
+
37
+ def validator(content)
38
+ RenderEditorjs::Validator.new(content, SCHEMA)
39
+ end
36
40
  end
37
41
  end
@@ -4,50 +4,54 @@ module RenderEditorjs
4
4
  class Document
5
5
  attr_reader :renderer, :content, :errors
6
6
 
7
- def initialize(renderer, content)
7
+ def initialize(content, renderer = RenderEditorjs::DefaultRenderer.new)
8
8
  @renderer = renderer
9
9
  @content = content.is_a?(Hash) ? content : JSON.parse(content)
10
-
11
- @block_renderers = {}
12
10
  @errors = []
13
11
  end
14
12
 
15
- def validate_blocks
16
- content["blocks"].each do |block|
17
- block_renderer = block_renderers(block["type"])
18
- next unless block_renderer
13
+ def valid?
14
+ return false unless valid_renderer?
19
15
 
20
- validator = block_renderer.validator(block)
21
- @errors << validator.errors unless validator.valid?
22
- end
23
- end
16
+ validate_blocks
24
17
 
25
- def block_renderers(block_type)
26
- @block_renderers[block_type] ||= renderer.mapping[block_type]
18
+ @errors.empty?
27
19
  end
28
20
 
29
- def validator
30
- @validator ||= RenderEditorjs::Validator.new(content, renderer.class::SCHEMA)
21
+ def render
22
+ return "" unless valid_renderer?
23
+
24
+ content["blocks"].map do |block|
25
+ block_renderer = block_renderers(block["type"])
26
+ next unless block_renderer
27
+
28
+ block_renderer.render(block["data"])
29
+ end.join
31
30
  end
32
31
 
33
- def valid?
34
- validator.validate!
35
- validate_blocks
32
+ private
36
33
 
37
- @errors.empty?
34
+ def valid_renderer?
35
+ renderer.validator(content).validate!
38
36
  rescue JSON::Schema::ValidationError => e
39
37
  @errors << e.message
40
38
 
41
39
  false
42
40
  end
43
41
 
44
- def render
45
- content["blocks"].map do |block|
42
+ def validate_blocks
43
+ content["blocks"].each do |block|
46
44
  block_renderer = block_renderers(block["type"])
47
45
  next unless block_renderer
48
46
 
49
- block_renderer.render(block["data"])
50
- end.join
47
+ validator = block_renderer.validator(block["data"])
48
+ @errors << validator.errors unless validator.valid?
49
+ end
50
+ end
51
+
52
+ def block_renderers(block_type)
53
+ @block_renderers ||= {}
54
+ @block_renderers[block_type] ||= renderer.mapping[block_type]
51
55
  end
52
56
  end
53
57
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RenderEditorjs
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.1"
5
5
  end
@@ -9,9 +9,7 @@ loader = Zeitwerk::Loader.for_gem
9
9
  loader.setup
10
10
 
11
11
  module RenderEditorjs
12
- class Error < StandardError; end
13
-
14
12
  def self.render(content)
15
- RenderEditorjs::Document.new(RenderEditorjs::DefaultRenderer.new, content).render
13
+ RenderEditorjs::Document.new(content).render
16
14
  end
17
15
  end
@@ -8,8 +8,7 @@ Gem::Specification.new do |spec|
8
8
  spec.authors = ["José Galisteo"]
9
9
  spec.email = ["ceritium@gmail.com"]
10
10
 
11
- spec.summary = "A modular and customizable Ruby renderer for [Editor.js](https://editorjs.io/).
12
- "
11
+ spec.summary = "A modular and customizable Ruby renderer for https://editorjs.io"
13
12
  spec.homepage = "https://github.com/ceritium/render_editorjs"
14
13
  spec.license = "MIT"
15
14
  spec.required_ruby_version = Gem::Requirement.new(">= 2.5.0")
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.0
4
+ version: 0.1.1
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-06 00:00:00.000000000 Z
11
+ date: 2021-11-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionview
@@ -73,12 +73,15 @@ executables: []
73
73
  extensions: []
74
74
  extra_rdoc_files: []
75
75
  files:
76
+ - ".github/workflows/ci.yml"
77
+ - ".github/workflows/codeql-analysis.yml"
76
78
  - ".gitignore"
77
79
  - ".rubocop.yml"
78
80
  - ".travis.yml"
79
81
  - CODE_OF_CONDUCT.md
80
82
  - Gemfile
81
83
  - Gemfile.lock
84
+ - Guardfile
82
85
  - LICENSE.txt
83
86
  - README.md
84
87
  - Rakefile
@@ -119,5 +122,5 @@ requirements: []
119
122
  rubygems_version: 3.1.6
120
123
  signing_key:
121
124
  specification_version: 4
122
- summary: A modular and customizable Ruby renderer for [Editor.js](https://editorjs.io/).
125
+ summary: A modular and customizable Ruby renderer for https://editorjs.io
123
126
  test_files: []