tiptap-ruby 0.10.0 → 0.11.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/CHANGELOG.md +8 -0
- data/lib/tip_tap/nodes/heading.rb +18 -0
- data/lib/tip_tap/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e1384c70d13fd9f99bcef31dd08ae4b5138e8616b9d102d700f232c62f33c58c
|
|
4
|
+
data.tar.gz: a04b8c83989127b39752a98df22dd829abd3b549dcc0885656a650e6d84fecfe
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5f33cb93676c699709df6ad62151d6faa801b765a45cac5264d440328f1e49b21c3b1d0f191b1f0cf7d2fe55cb8149bd95aac3ac459dcd22a4c2a0e1aa53709e
|
|
7
|
+
data.tar.gz: 4c9c9310854d7455cbf5a10e58b230a827ede264dbc17bd7946a7429f5955b984add66d05cf6dbfec1ea347b5c1c6eea8359e89f3ff6b4d6e8549e63dadbad94
|
data/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,13 @@ module TipTap
|
|
|
8
8
|
self.type_name = "heading"
|
|
9
9
|
self.html_tag = proc { "h#{level}" }
|
|
10
10
|
|
|
11
|
+
def initialize(content = [], **attributes)
|
|
12
|
+
super(content, **attributes)
|
|
13
|
+
uuid = SecureRandom.uuid
|
|
14
|
+
@attrs["id"] = uuid
|
|
15
|
+
@attrs["data-toc-id"] = uuid
|
|
16
|
+
end
|
|
17
|
+
|
|
11
18
|
def text(text, marks: [])
|
|
12
19
|
add_content(Text.new(text, marks: marks))
|
|
13
20
|
end
|
|
@@ -16,6 +23,17 @@ module TipTap
|
|
|
16
23
|
attrs["level"]
|
|
17
24
|
end
|
|
18
25
|
|
|
26
|
+
def html_attributes
|
|
27
|
+
# doc-toc-id comes from TipTap and Ruby symbols do not support -
|
|
28
|
+
# so we use string keys here instead.
|
|
29
|
+
{
|
|
30
|
+
"style" => inline_styles,
|
|
31
|
+
"class" => html_class_name,
|
|
32
|
+
"id" => attrs["id"],
|
|
33
|
+
"data-toc-id" => attrs["data-toc-id"]
|
|
34
|
+
}.reject { |key, value| value.blank? }
|
|
35
|
+
end
|
|
36
|
+
|
|
19
37
|
def to_markdown(context = Markdown::Context.root)
|
|
20
38
|
heading_level = [level.to_i, 1].max
|
|
21
39
|
prefix = "#" * heading_level
|
data/lib/tip_tap/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: tiptap-ruby
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.11.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Chad Wilken
|
|
@@ -29,14 +29,14 @@ dependencies:
|
|
|
29
29
|
requirements:
|
|
30
30
|
- - ">="
|
|
31
31
|
- !ruby/object:Gem::Version
|
|
32
|
-
version:
|
|
32
|
+
version: 7.2.3.1
|
|
33
33
|
type: :runtime
|
|
34
34
|
prerelease: false
|
|
35
35
|
version_requirements: !ruby/object:Gem::Requirement
|
|
36
36
|
requirements:
|
|
37
37
|
- - ">="
|
|
38
38
|
- !ruby/object:Gem::Version
|
|
39
|
-
version:
|
|
39
|
+
version: 7.2.3.1
|
|
40
40
|
description: A gem for parsing, generating, and rendering TipTap Documents and Nodes
|
|
41
41
|
using Ruby.
|
|
42
42
|
email:
|
|
@@ -98,7 +98,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
98
98
|
- !ruby/object:Gem::Version
|
|
99
99
|
version: '0'
|
|
100
100
|
requirements: []
|
|
101
|
-
rubygems_version:
|
|
101
|
+
rubygems_version: 4.0.20
|
|
102
102
|
specification_version: 4
|
|
103
103
|
summary: Parse, generate and render TipTap documents in Ruby.
|
|
104
104
|
test_files: []
|