coradoc-adoc 2.0.6 → 2.0.7
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/asciidoc/transformer/list_rules.rb +15 -20
- data/lib/coradoc/asciidoc/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: a29195095ab66adca7be3bdfcb331f71fdd69954c09ea3fc0cef33c4583b8d8c
|
|
4
|
+
data.tar.gz: 805db091f5043a01ce0b4ff1501c009814c4fdd079ca402a0232b2e3abf073dd
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a306bb17db95c5732e1a7e76f101c45a00363c356ebdc0b3d699961caa1a82c6ce2be1f69c531922cb83f53eb49c58735ca814e14a0559a431ee8c9a5ed56a00
|
|
7
|
+
data.tar.gz: 42c724be473f6bbdd0b9db339b0ac5a02590fa760f74178088536226380994ef52a812bb7730038e5fe66e25ad888a03b0a4b38c993dbdb5748a4f56e00923df
|
|
@@ -108,28 +108,23 @@ module Coradoc
|
|
|
108
108
|
rule(
|
|
109
109
|
definition_list_item: subtree(:item_data)
|
|
110
110
|
) do
|
|
111
|
-
|
|
112
|
-
definition = item_data[:definition]
|
|
111
|
+
data = item_data.is_a?(Hash) ? item_data : { terms: Array(item_data), definition: '' }
|
|
113
112
|
|
|
114
|
-
# Extract terms and optional id from structured dlist_term output
|
|
115
113
|
item_id = nil
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
contents = definition.to_s
|
|
131
|
-
|
|
132
|
-
Model::List::DefinitionItem.new(terms: terms, contents: contents, id: item_id)
|
|
114
|
+
terms_data = data[:terms]
|
|
115
|
+
definition = data[:definition].to_s
|
|
116
|
+
|
|
117
|
+
terms = Array(terms_data).map do |t|
|
|
118
|
+
case t
|
|
119
|
+
when Hash
|
|
120
|
+
item_id ||= t[:id].to_s if t[:id]
|
|
121
|
+
t[:text].to_s
|
|
122
|
+
else
|
|
123
|
+
t.to_s
|
|
124
|
+
end
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
Model::List::DefinitionItem.new(terms: terms, contents: definition, id: item_id)
|
|
133
128
|
end
|
|
134
129
|
|
|
135
130
|
rule(definition_list: sequence(:list_items)) do
|