draftjs_html 0.30.0 → 0.31.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/draftjs_html/draftjs/block.rb +4 -0
- data/lib/draftjs_html/draftjs/content.rb +15 -0
- data/lib/draftjs_html/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 664e4ae07bc1d64294767d98e5a41b2adf8f998dcf6b7109d30b924d2947f931
|
4
|
+
data.tar.gz: 6e3a4339a7a2c0d812d64b19260a8c57c1ca9b52ee8cb61969645bf1d75a0558
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aa6e7d24bf3389ab5cec981ec5e22f0a1ef10e68b51479a33ae54eaa0701b110b5b21fae3c1b7a14936dff54fb29bf52bc3c92a6202511ed463ffe1c770b1e32
|
7
|
+
data.tar.gz: 3897c00b471a7dc3dec926f90c8047d71d38ff9299acc7a9a8435a52b2d4b4ec204892cbadadf3269131a12e0d87d119b01f8eae81cecfd95727ce08644c0ac4
|
@@ -18,9 +18,24 @@ module DraftjsHtml
|
|
18
18
|
entity_map[key]
|
19
19
|
end
|
20
20
|
|
21
|
+
def attach_entity(entity, block, range)
|
22
|
+
new_key = new_entity_key
|
23
|
+
entity_map[new_key] = entity
|
24
|
+
block.add_entity(new_key, range)
|
25
|
+
end
|
26
|
+
|
21
27
|
def to_raw
|
22
28
|
ToRaw.new.convert(self)
|
23
29
|
end
|
30
|
+
|
31
|
+
private
|
32
|
+
|
33
|
+
def new_entity_key
|
34
|
+
loop do
|
35
|
+
key = SecureRandom.uuid
|
36
|
+
break key unless entity_map.key?(key)
|
37
|
+
end
|
38
|
+
end
|
24
39
|
end
|
25
40
|
end
|
26
41
|
end
|
data/lib/draftjs_html/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: draftjs_html
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.31.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- TJ Taylor
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-08-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|
@@ -88,7 +88,7 @@ metadata:
|
|
88
88
|
homepage_uri: https://github.com/dugancathal/draftjs_html
|
89
89
|
source_code_uri: https://github.com/dugancathal/draftjs_html
|
90
90
|
changelog_uri: https://github.com/dugancathal/draftjs_html/tree/main/CHANGELOG.md
|
91
|
-
post_install_message:
|
91
|
+
post_install_message:
|
92
92
|
rdoc_options: []
|
93
93
|
require_paths:
|
94
94
|
- lib
|
@@ -103,8 +103,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
103
103
|
- !ruby/object:Gem::Version
|
104
104
|
version: '0'
|
105
105
|
requirements: []
|
106
|
-
rubygems_version: 3.
|
107
|
-
signing_key:
|
106
|
+
rubygems_version: 3.4.10
|
107
|
+
signing_key:
|
108
108
|
specification_version: 4
|
109
109
|
summary: A tool for converting DraftJS JSON to HTML (and back again)
|
110
110
|
test_files: []
|