coradoc 2.0.29 → 2.0.30
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/coradoc/core_model/list_block.rb +45 -60
- data/lib/coradoc/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9ebca4a6342273f099bbbd2b47471ea28416669106fe33ee08dc929387019334
|
|
4
|
+
data.tar.gz: ee9464a2876d263910ff6f03694a3370dc259a6d040fc7ea27e9ef7a13d66430
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a0df65e13a8ef23c1a09b31fe9872cf1b5fec5b71528765c4c09651eb63edc9d4ec18d88b64b4276e881a6de04ce1cf8fd75c3b88ab45d2516c5da1fd5160eee
|
|
7
|
+
data.tar.gz: d1ee6224713d08bbd2270917c59f7106235216d2253a0a5639c6079497649561dee38cb6962fc8515ee6688619e71ce745fe365132c9334fd5484796fd1188b4
|
|
@@ -2,57 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
module Coradoc
|
|
4
4
|
module CoreModel
|
|
5
|
-
# Represents a single item within a list
|
|
6
|
-
#
|
|
7
|
-
# A list item can contain:
|
|
8
|
-
# - Simple text content
|
|
9
|
-
# - A nested list
|
|
10
|
-
# - Child elements (paragraphs, blocks, etc.)
|
|
11
|
-
#
|
|
12
|
-
# Note: The nested_list attribute type is set after ListBlock is defined
|
|
13
|
-
# to avoid circular dependency issues.
|
|
14
|
-
#
|
|
15
|
-
# @example Simple list item
|
|
16
|
-
# item = ListItem.new(
|
|
17
|
-
# marker: "*",
|
|
18
|
-
# content: "Item text"
|
|
19
|
-
# )
|
|
20
|
-
#
|
|
21
|
-
# @example List item with nested list
|
|
22
|
-
# item = ListItem.new(
|
|
23
|
-
# marker: "*",
|
|
24
|
-
# content: "Parent item",
|
|
25
|
-
# nested_list: nested_list_block
|
|
26
|
-
# )
|
|
27
|
-
class ListItem < Base
|
|
28
|
-
# @!attribute marker
|
|
29
|
-
# @return [String, nil] the marker character(s) for this item
|
|
30
|
-
# (e.g., '*', '**', '.', '..', '-')
|
|
31
|
-
attribute :marker, :string
|
|
32
|
-
|
|
33
|
-
# @!attribute content
|
|
34
|
-
# @return [String, nil] text content of the list item
|
|
35
|
-
attribute :content, :string
|
|
36
|
-
|
|
37
|
-
# @!attribute nested_list
|
|
38
|
-
# @return [ListBlock, nil] nested list within this item
|
|
39
|
-
# Note: Typed as string initially, retyped after ListBlock defined
|
|
40
|
-
attribute :nested_list, :string
|
|
41
|
-
|
|
42
|
-
private
|
|
43
|
-
|
|
44
|
-
# Attributes to compare for semantic equivalence
|
|
45
|
-
#
|
|
46
|
-
# List items are semantically equivalent if they have the same
|
|
47
|
-
# content, nested list, and children, regardless of the specific
|
|
48
|
-
# marker used.
|
|
49
|
-
#
|
|
50
|
-
# @return [Array<Symbol>] list of comparable attributes
|
|
51
|
-
def comparable_attributes
|
|
52
|
-
%i[content nested_list children]
|
|
53
|
-
end
|
|
54
|
-
end
|
|
55
|
-
|
|
56
5
|
# Represents a list block with proper nesting support
|
|
57
6
|
#
|
|
58
7
|
# Handles all list types:
|
|
@@ -106,7 +55,7 @@ module Coradoc
|
|
|
106
55
|
|
|
107
56
|
# @!attribute items
|
|
108
57
|
# @return [Array<ListItem>] collection of list items
|
|
109
|
-
attribute :items, ListItem, collection: true
|
|
58
|
+
attribute :items, 'Coradoc::CoreModel::ListItem', collection: true
|
|
110
59
|
|
|
111
60
|
# -- Fluent construction helpers (paired with Base.build) --
|
|
112
61
|
|
|
@@ -138,15 +87,51 @@ module Coradoc
|
|
|
138
87
|
end
|
|
139
88
|
end
|
|
140
89
|
|
|
141
|
-
#
|
|
142
|
-
#
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
90
|
+
# Represents a single item within a list
|
|
91
|
+
#
|
|
92
|
+
# A list item can contain:
|
|
93
|
+
# - Simple text content
|
|
94
|
+
# - A nested list
|
|
95
|
+
# - Child elements (paragraphs, blocks, etc.)
|
|
96
|
+
#
|
|
97
|
+
# @example Simple list item
|
|
98
|
+
# item = ListItem.new(
|
|
99
|
+
# marker: "*",
|
|
100
|
+
# content: "Item text"
|
|
101
|
+
# )
|
|
102
|
+
#
|
|
103
|
+
# @example List item with nested list
|
|
104
|
+
# item = ListItem.new(
|
|
105
|
+
# marker: "*",
|
|
106
|
+
# content: "Parent item",
|
|
107
|
+
# nested_list: nested_list_block
|
|
108
|
+
# )
|
|
109
|
+
class ListItem < Base
|
|
110
|
+
# @!attribute marker
|
|
111
|
+
# @return [String, nil] the marker character(s) for this item
|
|
112
|
+
# (e.g., '*', '**', '.', '..', '-')
|
|
113
|
+
attribute :marker, :string
|
|
114
|
+
|
|
115
|
+
# @!attribute content
|
|
116
|
+
# @return [String, nil] text content of the list item
|
|
117
|
+
attribute :content, :string
|
|
118
|
+
|
|
119
|
+
# @!attribute nested_list
|
|
120
|
+
# @return [ListBlock, nil] nested list within this item
|
|
121
|
+
attribute :nested_list, Coradoc::CoreModel::ListBlock
|
|
122
|
+
|
|
123
|
+
private
|
|
147
124
|
|
|
148
|
-
#
|
|
149
|
-
|
|
125
|
+
# Attributes to compare for semantic equivalence
|
|
126
|
+
#
|
|
127
|
+
# List items are semantically equivalent if they have the same
|
|
128
|
+
# content, nested list, and children, regardless of the specific
|
|
129
|
+
# marker used.
|
|
130
|
+
#
|
|
131
|
+
# @return [Array<Symbol>] list of comparable attributes
|
|
132
|
+
def comparable_attributes
|
|
133
|
+
%i[content nested_list children]
|
|
134
|
+
end
|
|
150
135
|
end
|
|
151
136
|
end
|
|
152
137
|
end
|
data/lib/coradoc/version.rb
CHANGED