draftjs_html 0.1.0 → 0.2.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/.travis.yml +6 -0
- data/README.md +6 -3
- data/lib/draftjs_html/draftjs/block.rb +4 -0
- data/lib/draftjs_html/to_html.rb +2 -0
- data/lib/draftjs_html/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 46ca7464191e9b163ce7d7a9e4175543606090934f08a8190dfd6a2ba4d946ed
|
4
|
+
data.tar.gz: 87288cdb9b61b818aa39083571e61f5b34e3f0d60b50d3b58da72b6ce057173f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 52303e5b9f6ce70f2b2736fa34ebaada69e26ce709bfc263302cea4746aad00b8f9a831118e921ada1adb8d7c5eee700388685475347fda38008d27a5575ff73
|
7
|
+
data.tar.gz: ca29270b828f3bb15db3e958f7ead590df908bf66d4f0300734d26eba62fa89d9a1001ff3b672b4c67ce4d225d318cbc15eb72b274bd1c308d951ed4155bcbe0
|
data/.travis.yml
ADDED
data/README.md
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
# DraftjsHtml
|
2
2
|
|
3
|
+
[](https://badge.fury.io/rb/draftjs_html)
|
4
|
+
[](https://app.travis-ci.com/dugancathal/draftjs_html)
|
5
|
+
|
3
6
|
This gem provides conversion utilities between "raw" [DraftJS] JSON and HTML.
|
4
7
|
My team and I have found a need on many occasions to manipulate and convert
|
5
8
|
DraftJS on our Ruby backend - this library is the result.
|
@@ -56,11 +59,11 @@ raw_draftjs = {
|
|
56
59
|
|
57
60
|
DraftjsHtml.to_html(raw_draftjs, {
|
58
61
|
entity_style_mappings: {
|
59
|
-
|
60
|
-
%Q{<a href="
|
62
|
+
abc: ->(entity, content) {
|
63
|
+
%Q{<a href="https://example.com/?id=#{entity.data['user_id']}">#{content}</a>}
|
61
64
|
},
|
62
65
|
},
|
63
|
-
}) # => <p>Hello </p>
|
66
|
+
}) # => <p>Hello <a href="https://example.com/?id=123">@Arya</a></p>
|
64
67
|
```
|
65
68
|
|
66
69
|
Almost all of the options support Procs (or otherwise `.call`-ables) to provide
|
data/lib/draftjs_html/to_html.rb
CHANGED
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.2.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: 2022-
|
11
|
+
date: 2022-10-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|
@@ -47,6 +47,7 @@ extra_rdoc_files: []
|
|
47
47
|
files:
|
48
48
|
- ".gitignore"
|
49
49
|
- ".rspec"
|
50
|
+
- ".travis.yml"
|
50
51
|
- CODE_OF_CONDUCT.md
|
51
52
|
- Gemfile
|
52
53
|
- LICENSE.txt
|