render_editorjs 0.1.2 → 0.1.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 17d71c6a02cdf09a42ce8ccf6afca1c6f1b2012c53bab180495edfd108e8925d
4
- data.tar.gz: 561a793a12443799619492ecd330d4cd5227ecdba0028134df18d449d0549e74
3
+ metadata.gz: 02d03a5fea8db48118e679aa1c956e6e91ea551cc5ee211384b36806a866dbfa
4
+ data.tar.gz: f07ed69a71fc542678f3ccb47cdadef1f147860a3f88844b82362472dbb9f09d
5
5
  SHA512:
6
- metadata.gz: 0b9b67ff143aac683babff133f6a721b70ce5c74e5b4384a0080a9a234037c2bd3cdd7e3f4288568e1258bb7c0823d50af8a7038a589616063562376d45f0050
7
- data.tar.gz: e3361768bdc3d0caf6bfa8b42470961e7a51f8fee1162d2ae001f2526b96c9268baf9e54d5bec47eae5d6621d5426db13c5bf97ffc83a3ed2a04c703b7e63791
6
+ metadata.gz: 96200bcdf8cb481c97678fa476ad2f632fd5cf1f38a07e8a878c127fc68d094ebc920a25361dab42b020510f00a9be6ea03da769c7429df98cae3bdd4f5b33b6
7
+ data.tar.gz: 2d16c244edffa752fb3459a9e944e472b835578c88e6d85f38d33a842a37f83f2641bd6f0a6a0edb8e9df53ebebeea36b63ee1fd91d85998d82906ade2b41bb9
@@ -12,8 +12,7 @@ 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.3]
17
16
  steps:
18
17
  - uses: actions/checkout@v2
19
18
  - 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.2)
4
+ render_editorjs (0.1.3)
5
5
  actionview (>= 4)
6
6
  json-schema (~> 2)
7
7
  sanitize (~> 6.0.0)
@@ -10,18 +10,17 @@ PATH
10
10
  GEM
11
11
  remote: https://rubygems.org/
12
12
  specs:
13
- actionview (6.1.4.1)
14
- activesupport (= 6.1.4.1)
13
+ actionview (7.0.0)
14
+ activesupport (= 7.0.0)
15
15
  builder (~> 3.1)
16
16
  erubi (~> 1.4)
17
17
  rails-dom-testing (~> 2.0)
18
18
  rails-html-sanitizer (~> 1.1, >= 1.2.0)
19
- activesupport (6.1.4.1)
19
+ activesupport (7.0.0)
20
20
  concurrent-ruby (~> 1.0, >= 1.0.2)
21
21
  i18n (>= 1.6, < 2)
22
22
  minitest (>= 5.1)
23
23
  tzinfo (~> 2.0)
24
- zeitwerk (~> 2.3)
25
24
  addressable (2.8.0)
26
25
  public_suffix (>= 2.0.2, < 5.0)
27
26
  ansi (1.5.0)
@@ -54,12 +53,11 @@ GEM
54
53
  listen (3.7.0)
55
54
  rb-fsevent (~> 0.10, >= 0.10.3)
56
55
  rb-inotify (~> 0.9, >= 0.9.10)
57
- loofah (2.12.0)
56
+ loofah (2.13.0)
58
57
  crass (~> 1.0.2)
59
58
  nokogiri (>= 1.5.9)
60
59
  lumberjack (1.2.8)
61
60
  method_source (1.0.0)
62
- mini_portile2 (2.6.1)
63
61
  minitest (5.14.4)
64
62
  minitest-focus (1.3.1)
65
63
  minitest (>= 4, < 6)
@@ -71,8 +69,7 @@ GEM
71
69
  minitest (>= 5.0)
72
70
  ruby-progressbar
73
71
  nenv (0.3.0)
74
- nokogiri (1.12.5)
75
- mini_portile2 (~> 2.6.1)
72
+ nokogiri (1.12.5-x86_64-darwin)
76
73
  racc (~> 1.4)
77
74
  notiffany (0.1.3)
78
75
  nenv (~> 0.1)
@@ -5,11 +5,7 @@ module RenderEditorjs
5
5
  # Compatible with default Paragraph and paragraph-with-aligment
6
6
  # https://github.com/kaaaaaaaaaaai/paragraph-with-alignment
7
7
  class Paragraph < Base
8
- DEFAULT_OPTIONS = {
9
- tag: "p"
10
- }.freeze
11
-
12
- SAFE_TAGS = {
8
+ DEFAULT_SAFE_TAGS = {
13
9
  "b" => nil,
14
10
  "i" => nil,
15
11
  "u" => ["class"],
@@ -19,6 +15,10 @@ module RenderEditorjs
19
15
  "code" => ["class"]
20
16
  }.freeze
21
17
 
18
+ DEFAULT_OPTIONS = {
19
+ tag: "p"
20
+ }.freeze
21
+
22
22
  SCHEMA = YAML.safe_load(<<~YAML)
23
23
  type: object
24
24
  additionalProperties: false
@@ -35,8 +35,9 @@ module RenderEditorjs
35
35
 
36
36
  attr_reader :options
37
37
 
38
- def initialize(options = DEFAULT_OPTIONS)
38
+ def initialize(options = DEFAULT_OPTIONS.dup)
39
39
  @options = options
40
+ @options[:safe_tags] ||= DEFAULT_SAFE_TAGS
40
41
  super()
41
42
  end
42
43
 
@@ -53,8 +54,8 @@ module RenderEditorjs
53
54
  def sanitize(text)
54
55
  Sanitize.fragment(
55
56
  text,
56
- elements: SAFE_TAGS.keys,
57
- attributes: SAFE_TAGS.select { |_k, v| v },
57
+ elements: options[:safe_tags].keys,
58
+ attributes: options[:safe_tags].select { |_k, v| v },
58
59
  remove_contents: true
59
60
  )
60
61
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RenderEditorjs
4
- VERSION = "0.1.2"
4
+ VERSION = "0.1.3"
5
5
  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.2
4
+ version: 0.1.3
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-09 00:00:00.000000000 Z
11
+ date: 2022-01-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionview