draftjs_html 0.35.0 → 0.36.0
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/README.md +12 -0
- data/lib/draftjs_html/from_html.rb +2 -1
- 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: 1e387f747a717be70bd28676124ef2fe207666ad5c351bf49af1169b922d4b93
|
4
|
+
data.tar.gz: 13f2be9739e90a5dba546b36672f19620bd3ec97a6d4a3456a5d0bf4f4640ad8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f90c1e856259dae2d18b1585d4789d94327711c1dfc0d69e16b98d908a2fc5595b3b2eb8ddf31d9ff070e486b0bfd494661748f5d40633bcd0ebc2e5db7de624
|
7
|
+
data.tar.gz: 000bfb152cec564de907970839eabb90505fd3d62047171e7b61818e4e92f92b583bb03705d2ac26bee4704cb632ae9df637e1a3a4a2eefec1266ed46e66bfae
|
data/README.md
CHANGED
@@ -204,6 +204,18 @@ There are some known limitations with this approach, but, if you're just trying
|
|
204
204
|
to get started, it may be good enough for you. Contributions and issue reports
|
205
205
|
are welcome and encouraged.
|
206
206
|
|
207
|
+
### FromHtml Options
|
208
|
+
|
209
|
+
#### `:encoding`
|
210
|
+
|
211
|
+
Specify the HTML parsing encoding.
|
212
|
+
Defaults to `UTF-8`.
|
213
|
+
|
214
|
+
#### `:squeeze_whitespace_blocks`
|
215
|
+
|
216
|
+
Removes whitespace only blocks from the generated DraftJS.
|
217
|
+
Defaults to `false`.
|
218
|
+
|
207
219
|
#### `:node_to_entity:`
|
208
220
|
|
209
221
|
This `FromHtml` option allows the user to specify how a particular node is
|
@@ -10,7 +10,8 @@ module DraftjsHtml
|
|
10
10
|
|
11
11
|
def initialize(options = {})
|
12
12
|
@draftjs = Draftjs::RawBuilder.new
|
13
|
-
|
13
|
+
encoding = options.key?(:encoding) ? options.delete(:encoding) : 'UTF-8'
|
14
|
+
@parser = Nokogiri::HTML4::SAX::Parser.new(self, encoding)
|
14
15
|
@options = ensure_options!(options.dup)
|
15
16
|
@depth_stack = DepthStack.new(@options)
|
16
17
|
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.36.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- TJ Taylor
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-07-28 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.
|
108
|
+
rubygems_version: 3.5.21
|
109
109
|
signing_key:
|
110
110
|
specification_version: 4
|
111
111
|
summary: A tool for converting DraftJS JSON to HTML (and back again)
|