draftjs_html 0.36.0 → 0.36.1
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/lib/draftjs_html/draftjs/block.rb +4 -4
- data/lib/draftjs_html/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 478f44cf0bf0a4713a8ebe4e3af9fb6103d916a1f8586fb86fe9e28134a2a98b
|
|
4
|
+
data.tar.gz: 2854bb3c82fe36dd6b4a08b956753d4af42fca1e392437a06a1fc4cd3c31dc46
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a8ac3e83b1d70ddbbfcd2a89b39fd3d1b5dcdc51e174c1ff08ecca7ae084cdc916c59b6d4b6b59568d53c804c9a138a0afc2ef0c29616234839dbdbf18e7d0d4
|
|
7
|
+
data.tar.gz: d56609f7024deab8d3aeedb0e472e6eab4600013acdcb84d1d4fa6905845da8efa418a1bdbf74b9a03edb51a185c7cbcc2c8861b6713f224d745a95052553986
|
|
@@ -25,7 +25,7 @@ module DraftjsHtml
|
|
|
25
25
|
def each_char
|
|
26
26
|
return to_enum(:each_char) unless block_given?
|
|
27
27
|
|
|
28
|
-
text.
|
|
28
|
+
text.each_char.with_index do |char, index|
|
|
29
29
|
yield CharacterMeta.new(
|
|
30
30
|
char: char,
|
|
31
31
|
style_names: inline_styles.select { _1.range.cover?(index) }.map(&:name),
|
|
@@ -40,17 +40,17 @@ module DraftjsHtml
|
|
|
40
40
|
|
|
41
41
|
current_styles = []
|
|
42
42
|
current_entity = nil
|
|
43
|
-
ranges = [CharRange.new(text: '', style_names: current_styles, entity_key: current_entity)]
|
|
43
|
+
ranges = [CharRange.new(text: +'', style_names: current_styles, entity_key: current_entity)]
|
|
44
44
|
|
|
45
45
|
each_char.with_index do |char, index|
|
|
46
46
|
if char.style_names != current_styles || char.entity_key != current_entity
|
|
47
47
|
current_styles = char.style_names
|
|
48
48
|
current_entity = char.entity_key
|
|
49
49
|
yield(ranges.last) unless index == 0
|
|
50
|
-
ranges << CharRange.new(text: '', style_names: current_styles, entity_key: current_entity)
|
|
50
|
+
ranges << CharRange.new(text: +'', style_names: current_styles, entity_key: current_entity)
|
|
51
51
|
end
|
|
52
52
|
|
|
53
|
-
ranges.last.text
|
|
53
|
+
ranges.last.text << char.char
|
|
54
54
|
end
|
|
55
55
|
|
|
56
56
|
yield ranges.last
|
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.36.
|
|
4
|
+
version: 0.36.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- TJ Taylor
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2026-10-02 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: nokogiri
|
|
@@ -105,7 +105,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
105
105
|
- !ruby/object:Gem::Version
|
|
106
106
|
version: '0'
|
|
107
107
|
requirements: []
|
|
108
|
-
rubygems_version: 3.5.
|
|
108
|
+
rubygems_version: 3.5.22
|
|
109
109
|
signing_key:
|
|
110
110
|
specification_version: 4
|
|
111
111
|
summary: A tool for converting DraftJS JSON to HTML (and back again)
|