metanorma-standoc 1.9.0 → 1.10.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/.github/workflows/rake.yml +3 -13
- data/.hound.yml +3 -1
- data/.rubocop.yml +4 -8
- data/lib/asciidoctor/standoc/base.rb +31 -35
- data/lib/asciidoctor/standoc/biblio.rng +1 -0
- data/lib/asciidoctor/standoc/blocks.rb +25 -9
- data/lib/asciidoctor/standoc/blocks_notes.rb +41 -24
- data/lib/asciidoctor/standoc/cleanup.rb +59 -84
- data/lib/asciidoctor/standoc/cleanup_block.rb +63 -85
- data/lib/asciidoctor/standoc/cleanup_boilerplate.rb +28 -15
- data/lib/asciidoctor/standoc/cleanup_footnotes.rb +1 -0
- data/lib/asciidoctor/standoc/cleanup_image.rb +71 -0
- data/lib/asciidoctor/standoc/cleanup_inline.rb +117 -77
- data/lib/asciidoctor/standoc/cleanup_maths.rb +36 -27
- data/lib/asciidoctor/standoc/cleanup_ref.rb +31 -15
- data/lib/asciidoctor/standoc/cleanup_ref_dl.rb +1 -1
- data/lib/asciidoctor/standoc/cleanup_reqt.rb +47 -0
- data/lib/asciidoctor/standoc/cleanup_section.rb +77 -135
- data/lib/asciidoctor/standoc/cleanup_section_names.rb +75 -0
- data/lib/asciidoctor/standoc/cleanup_terms.rb +19 -18
- data/lib/asciidoctor/standoc/converter.rb +7 -2
- data/lib/asciidoctor/standoc/datamodel/plantuml_renderer.rb +67 -66
- data/lib/asciidoctor/standoc/front.rb +35 -18
- data/lib/asciidoctor/standoc/front_contributor.rb +70 -45
- data/lib/asciidoctor/standoc/inline.rb +45 -34
- data/lib/asciidoctor/standoc/isodoc.rng +209 -4
- data/lib/asciidoctor/standoc/lists.rb +4 -2
- data/lib/asciidoctor/standoc/macros.rb +11 -11
- data/lib/asciidoctor/standoc/macros_form.rb +63 -0
- data/lib/asciidoctor/standoc/macros_plantuml.rb +19 -21
- data/lib/asciidoctor/standoc/macros_terms.rb +33 -23
- data/lib/asciidoctor/standoc/ref.rb +87 -112
- data/lib/asciidoctor/standoc/ref_date_id.rb +62 -0
- data/lib/asciidoctor/standoc/ref_sect.rb +20 -17
- data/lib/asciidoctor/standoc/section.rb +3 -1
- data/lib/asciidoctor/standoc/term_lookup_cleanup.rb +40 -27
- data/lib/asciidoctor/standoc/terms.rb +25 -18
- data/lib/asciidoctor/standoc/utils.rb +35 -9
- data/lib/asciidoctor/standoc/validate.rb +48 -33
- data/lib/metanorma-standoc.rb +0 -1
- data/lib/metanorma/standoc/version.rb +1 -1
- data/metanorma-standoc.gemspec +4 -4
- data/spec/asciidoctor/base_spec.rb +701 -508
- data/spec/asciidoctor/blocks_spec.rb +831 -738
- data/spec/asciidoctor/cleanup_sections_spec.rb +51 -14
- data/spec/asciidoctor/cleanup_spec.rb +889 -682
- data/spec/asciidoctor/inline_spec.rb +62 -14
- data/spec/asciidoctor/isobib_cache_spec.rb +404 -358
- data/spec/asciidoctor/lists_spec.rb +149 -137
- data/spec/asciidoctor/macros_plantuml_spec.rb +8 -8
- data/spec/asciidoctor/macros_spec.rb +923 -503
- data/spec/asciidoctor/macros_yaml2text_spec.rb +1 -1
- data/spec/asciidoctor/refs_dl_spec.rb +4 -4
- data/spec/asciidoctor/refs_spec.rb +1528 -1533
- data/spec/asciidoctor/section_spec.rb +405 -299
- data/spec/asciidoctor/table_spec.rb +6 -6
- data/spec/asciidoctor/validate_spec.rb +342 -304
- data/spec/spec_helper.rb +13 -9
- data/spec/vcr_cassettes/dated_iso_ref_joint_iso_iec.yml +54 -54
- data/spec/vcr_cassettes/isobib_get_123.yml +13 -13
- data/spec/vcr_cassettes/isobib_get_123_1.yml +25 -25
- data/spec/vcr_cassettes/isobib_get_123_1_fr.yml +37 -37
- data/spec/vcr_cassettes/isobib_get_123_2001.yml +12 -12
- data/spec/vcr_cassettes/isobib_get_124.yml +13 -13
- data/spec/vcr_cassettes/rfcbib_get_rfc8341.yml +14 -14
- data/spec/vcr_cassettes/separates_iev_citations_by_top_level_clause.yml +46 -46
- metadata +16 -15
- data/lib/liquid/custom_blocks/key_iterator.rb +0 -21
- data/lib/liquid/custom_blocks/with_json_nested_context.rb +0 -18
- data/lib/liquid/custom_blocks/with_yaml_nested_context.rb +0 -19
- data/lib/liquid/custom_filters/values.rb +0 -7
@@ -2,7 +2,7 @@ require "spec_helper"
|
|
2
2
|
|
3
3
|
RSpec.describe Asciidoctor::Standoc do
|
4
4
|
it "processes simple lists" do
|
5
|
-
output = Asciidoctor.convert(<<~"INPUT",
|
5
|
+
output = Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
6
6
|
#{ASCIIDOC_BLANK_HDR}
|
7
7
|
* List 1
|
8
8
|
* List 2
|
@@ -21,56 +21,56 @@ RSpec.describe Asciidoctor::Standoc do
|
|
21
21
|
|
22
22
|
INPUT
|
23
23
|
expect(xmlpp(strip_guid(output))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
</standard-document>
|
24
|
+
#{BLANK_HDR}
|
25
|
+
<sections>
|
26
|
+
<ul id='_'>
|
27
|
+
<li>
|
28
|
+
<p id='_'>List 1</p>
|
29
|
+
</li>
|
30
|
+
<li>
|
31
|
+
<p id='_'>List 2</p>
|
32
|
+
</li>
|
33
|
+
<li>
|
34
|
+
<p id='_'>List 3</p>
|
35
|
+
</li>
|
36
|
+
<li uncheckedcheckbox='false' checkedcheckbox='true'>
|
37
|
+
<p id='_'>checked</p>
|
38
|
+
</li>
|
39
|
+
<li uncheckedcheckbox='false' checkedcheckbox='true'>
|
40
|
+
<p id='_'>also checked</p>
|
41
|
+
</li>
|
42
|
+
<li uncheckedcheckbox='true' checkedcheckbox='false'>
|
43
|
+
<p id='_'>not checked</p>
|
44
|
+
<ol id='_' type='arabic'>
|
45
|
+
<li>
|
46
|
+
<p id='_'>List A</p>
|
47
|
+
</li>
|
48
|
+
<li>
|
49
|
+
<p id='_'>List B</p>
|
50
|
+
</li>
|
51
|
+
<li>
|
52
|
+
<p id='_'>List C</p>
|
53
|
+
<dl id='_'>
|
54
|
+
<dt>List D</dt>
|
55
|
+
<dd>
|
56
|
+
<p id='_'>List E</p>
|
57
|
+
</dd>
|
58
|
+
<dt>List F</dt>
|
59
|
+
<dd>
|
60
|
+
<p id='_'>List G</p>
|
61
|
+
</dd>
|
62
|
+
</dl>
|
63
|
+
</li>
|
64
|
+
</ol>
|
65
|
+
</li>
|
66
|
+
</ul>
|
67
|
+
</sections>
|
68
|
+
</standard-document>
|
69
69
|
OUTPUT
|
70
70
|
end
|
71
71
|
|
72
|
-
|
73
|
-
output = Asciidoctor.convert(<<~"INPUT",
|
72
|
+
it "processes complex lists" do
|
73
|
+
output = Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
74
74
|
#{ASCIIDOC_BLANK_HDR}
|
75
75
|
[[id]]
|
76
76
|
[keep-with-next=true,keep-lines-together=true]
|
@@ -116,99 +116,111 @@ RSpec.describe Asciidoctor::Standoc do
|
|
116
116
|
|
117
117
|
INPUT
|
118
118
|
expect(xmlpp(strip_guid(output))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
</
|
186
|
-
</
|
187
|
-
|
188
|
-
|
189
|
-
end
|
119
|
+
#{BLANK_HDR}
|
120
|
+
<sections><ul id="id" keep-with-next="true" keep-lines-together="true">
|
121
|
+
<li>
|
122
|
+
<p id="_">First</p>
|
123
|
+
</li>
|
124
|
+
<li><p id="_">Second</p><p id="_">entry1</p>
|
125
|
+
<p id="_">entry2</p></li>
|
126
|
+
</ul>
|
127
|
+
<ol id="id1" type="alphabet" keep-with-next="true" keep-lines-together="true">
|
128
|
+
<li>
|
129
|
+
<p id="_">First</p>
|
130
|
+
</li>
|
131
|
+
<li>
|
132
|
+
<p id="_">Second</p>
|
133
|
+
<ol id="_" type="alphabet_upper">
|
134
|
+
<li>
|
135
|
+
<p id="_">Third</p>
|
136
|
+
</li>
|
137
|
+
<li>
|
138
|
+
<p id="_">Fourth</p>
|
139
|
+
</li>
|
140
|
+
</ol>
|
141
|
+
</li>
|
142
|
+
<li>
|
143
|
+
<p id="_">Fifth</p>
|
144
|
+
</li>
|
145
|
+
<li>
|
146
|
+
<p id="_">Sixth</p>
|
147
|
+
</li>
|
148
|
+
</ol>
|
149
|
+
<ol id="_" type="roman">
|
150
|
+
<li>
|
151
|
+
<p id="_">A</p>
|
152
|
+
</li>
|
153
|
+
<li>
|
154
|
+
<p id="_">B</p>
|
155
|
+
<ol id="_" type="roman_upper">
|
156
|
+
<li>
|
157
|
+
<p id="_">C</p>
|
158
|
+
</li>
|
159
|
+
<li>
|
160
|
+
<p id="_">D</p>
|
161
|
+
<ol id="_" type="arabic">
|
162
|
+
<li>
|
163
|
+
<p id="_">E</p>
|
164
|
+
</li>
|
165
|
+
<li>
|
166
|
+
<p id="_">F</p>
|
167
|
+
<dl id="_" keep-with-next="true" keep-lines-together="true">
|
168
|
+
<dt>Notes1</dt>
|
169
|
+
<dd/>
|
170
|
+
<dt>Notes</dt>
|
171
|
+
<dd><p id="_">Note 1.</p><p id="_">Note 2.</p>
|
172
|
+
<p id="_">Note 3.</p></dd>
|
173
|
+
</dl>
|
174
|
+
</li>
|
175
|
+
</ol>
|
176
|
+
</li>
|
177
|
+
</ol>
|
178
|
+
</li>
|
179
|
+
</ol><dl id='_' key='true'>
|
180
|
+
<dt>a</dt>
|
181
|
+
<dd>
|
182
|
+
<p id='_'>b</p>
|
183
|
+
</dd>
|
184
|
+
</dl>
|
185
|
+
</sections>
|
186
|
+
</standard-document>
|
187
|
+
OUTPUT
|
188
|
+
end
|
190
189
|
|
191
|
-
|
192
|
-
|
190
|
+
it "anchors lists and list items" do
|
191
|
+
input = <<~INPUT
|
193
192
|
#{ASCIIDOC_BLANK_HDR}
|
194
193
|
[[id1]]
|
195
194
|
* [[id2]] List item
|
196
195
|
* Hello [[id3]] List item
|
197
196
|
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
197
|
+
[[id4]]
|
198
|
+
[[id5]]a:: [[id6]]b
|
199
|
+
INPUT
|
200
|
+
output = <<~OUTPUT
|
201
|
+
#{BLANK_HDR}
|
202
|
+
<sections>
|
203
|
+
<ul id="id1">
|
204
|
+
<li id="id2">
|
205
|
+
<p id="_">List item</p>
|
206
|
+
</li>
|
207
|
+
<li>
|
208
|
+
<p id="_">Hello <bookmark id="id3"/> List item</p>
|
209
|
+
</li>
|
210
|
+
</ul>
|
211
|
+
<dl id='id4'>
|
212
|
+
<dt id='id5'>a</dt>
|
213
|
+
<dd>
|
214
|
+
<p id='_'>
|
215
|
+
<bookmark id='id6'/>
|
216
|
+
b
|
217
|
+
</p>
|
218
|
+
</dd>
|
219
|
+
</dl>
|
220
|
+
</sections>
|
221
|
+
</standard-document>
|
222
|
+
OUTPUT
|
223
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
224
|
+
.to be_equivalent_to xmlpp(output)
|
225
|
+
end
|
214
226
|
end
|
@@ -2,7 +2,7 @@ require "spec_helper"
|
|
2
2
|
|
3
3
|
RSpec.describe Asciidoctor::Standoc do
|
4
4
|
it "processes the PlantUML macro" do
|
5
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
5
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)).gsub(%r{plantuml/plantuml[^./]+\.}, "plantuml/_."))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
6
6
|
#{ASCIIDOC_BLANK_HDR}
|
7
7
|
|
8
8
|
[plantuml]
|
@@ -53,7 +53,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
53
53
|
end
|
54
54
|
|
55
55
|
it "processes the PlantUML macro with imagesdir" do
|
56
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
56
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)).gsub(%r{spec/assets/[^./]+\.}, "spec/assets/_."))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
57
57
|
= Document title
|
58
58
|
Author
|
59
59
|
:docfile: test.adoc
|
@@ -119,7 +119,7 @@ OUTPUT
|
|
119
119
|
it "processes the lutaml_diagram" do
|
120
120
|
expect(
|
121
121
|
xmlpp(
|
122
|
-
strip_guid(Asciidoctor.convert(input,
|
122
|
+
strip_guid(Asciidoctor.convert(input, *OPTIONS))
|
123
123
|
.gsub(%r{".+spec\/assets\/lutaml\/[^.\/]+\.}, %q("spec/assets/_.))))
|
124
124
|
.to(be_equivalent_to xmlpp(output))
|
125
125
|
end
|
@@ -187,14 +187,14 @@ OUTPUT
|
|
187
187
|
it "processes the lutaml_uml_attributes_table macro" do
|
188
188
|
expect(
|
189
189
|
xmlpp(
|
190
|
-
strip_guid(Asciidoctor.convert(input,
|
190
|
+
strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
191
191
|
.to(be_equivalent_to(xmlpp(output)))
|
192
192
|
end
|
193
193
|
end
|
194
194
|
|
195
195
|
it "processes the PlantUML macro with PlantUML disabled" do
|
196
196
|
mock_plantuml_disabled
|
197
|
-
expect { Asciidoctor.convert(<<~"INPUT",
|
197
|
+
expect { Asciidoctor.convert(<<~"INPUT", *OPTIONS) }.to output(%r{PlantUML not installed}).to_stderr
|
198
198
|
#{ASCIIDOC_BLANK_HDR}
|
199
199
|
|
200
200
|
[plantuml]
|
@@ -210,7 +210,7 @@ OUTPUT
|
|
210
210
|
INPUT
|
211
211
|
|
212
212
|
mock_plantuml_disabled
|
213
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
213
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
214
214
|
#{ASCIIDOC_BLANK_HDR}
|
215
215
|
|
216
216
|
[plantuml]
|
@@ -240,7 +240,7 @@ Alice <-- Bob: another authentication Response
|
|
240
240
|
|
241
241
|
it "processes the PlantUML macro with localdir unwritable" do
|
242
242
|
mock_localdir_unwritable
|
243
|
-
expect { Asciidoctor.convert(<<~"INPUT",
|
243
|
+
expect { Asciidoctor.convert(<<~"INPUT", *OPTIONS) }.to output(%r{not writable for PlantUML}).to_stderr
|
244
244
|
#{ASCIIDOC_BLANK_HDR}
|
245
245
|
|
246
246
|
[plantuml]
|
@@ -256,7 +256,7 @@ Alice <-- Bob: another authentication Response
|
|
256
256
|
INPUT
|
257
257
|
|
258
258
|
mock_localdir_unwritable
|
259
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
259
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
260
260
|
#{ASCIIDOC_BLANK_HDR}
|
261
261
|
|
262
262
|
[plantuml]
|
@@ -2,7 +2,7 @@ require "spec_helper"
|
|
2
2
|
|
3
3
|
RSpec.describe Asciidoctor::Standoc do
|
4
4
|
it "processes the Asciidoctor::Standoc inline macros" do
|
5
|
-
|
5
|
+
input = <<~INPUT
|
6
6
|
#{ASCIIDOC_BLANK_HDR}
|
7
7
|
alt:[term1]
|
8
8
|
deprecated:[term1]
|
@@ -15,43 +15,46 @@ RSpec.describe Asciidoctor::Standoc do
|
|
15
15
|
== Bibliography
|
16
16
|
* [[[ref1,XYZ 123]]] _Title_
|
17
17
|
INPUT
|
18
|
+
output = <<~OUTPUT
|
18
19
|
#{BLANK_HDR}
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
</preface>
|
36
|
-
<sections> </sections>
|
37
|
-
<bibliography>
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
</bibliography>
|
49
|
-
|
20
|
+
<preface>
|
21
|
+
<foreword id='_' obligation='informative'>
|
22
|
+
<title>Foreword</title>
|
23
|
+
<admitted>term1</admitted>
|
24
|
+
<deprecates>term1</deprecates>
|
25
|
+
<domain>term1</domain>
|
26
|
+
<inherit>
|
27
|
+
<eref type='inline' bibitemid='ref1' citeas='XYZ 123'/>
|
28
|
+
</inherit>
|
29
|
+
<autonumber type='table'>3</autonumber>
|
30
|
+
<add>
|
31
|
+
a
|
32
|
+
<xref target='clause'/>
|
33
|
+
</add>
|
34
|
+
<del>B</del>
|
35
|
+
</foreword>
|
36
|
+
</preface>
|
37
|
+
<sections> </sections>
|
38
|
+
<bibliography>
|
39
|
+
<references id='_' obligation='informative' normative="false">
|
40
|
+
<title>Bibliography</title>
|
41
|
+
<bibitem id='ref1'>
|
42
|
+
<formattedref format='application/x-isodoc+xml'>
|
43
|
+
<em>Title</em>
|
44
|
+
</formattedref>
|
45
|
+
<docidentifier>XYZ 123</docidentifier>
|
46
|
+
<docnumber>123</docnumber>
|
47
|
+
</bibitem>
|
48
|
+
</references>
|
49
|
+
</bibliography>
|
50
|
+
</standard-document>
|
50
51
|
OUTPUT
|
52
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
53
|
+
.to be_equivalent_to xmlpp(output)
|
51
54
|
end
|
52
55
|
|
53
56
|
it "processes the Asciidoctor::Standoc index macros" do
|
54
|
-
|
57
|
+
input = <<~INPUT
|
55
58
|
#{ASCIIDOC_BLANK_HDR}
|
56
59
|
index:also[]
|
57
60
|
index:see[A]
|
@@ -67,244 +70,448 @@ RSpec.describe Asciidoctor::Standoc do
|
|
67
70
|
|
68
71
|
Text [[id3]]
|
69
72
|
INPUT
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
</
|
97
|
-
|
98
|
-
<
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
</
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
</
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
</
|
73
|
+
output = <<~OUTPUT
|
74
|
+
#{BLANK_HDR}
|
75
|
+
<sections>
|
76
|
+
<p id='_'>
|
77
|
+
<index-xref also='true'>
|
78
|
+
<primary>B</primary>
|
79
|
+
<target>
|
80
|
+
C
|
81
|
+
<sub>x</sub>
|
82
|
+
</target>
|
83
|
+
</index-xref>
|
84
|
+
<index-xref also='false'>
|
85
|
+
<primary>D</primary>
|
86
|
+
<secondary>
|
87
|
+
<em>E</em>
|
88
|
+
</secondary>
|
89
|
+
<target>F</target>
|
90
|
+
</index-xref>
|
91
|
+
<index-xref also='true'>
|
92
|
+
<primary>G</primary>
|
93
|
+
<secondary>H</secondary>
|
94
|
+
<tertiary>I</tertiary>
|
95
|
+
<target>J</target>
|
96
|
+
</index-xref>
|
97
|
+
P
|
98
|
+
<index to="id2">
|
99
|
+
<primary>P</primary>
|
100
|
+
</index>
|
101
|
+
<em>P</em>
|
102
|
+
<index to="id3">
|
103
|
+
<primary>
|
104
|
+
<em>P</em>
|
105
|
+
</primary>
|
106
|
+
</index>
|
107
|
+
<index to="id3">
|
108
|
+
<primary>Q</primary>
|
109
|
+
<secondary>R</secondary>
|
110
|
+
<tertiary>S</tertiary>
|
111
|
+
</index>
|
112
|
+
</p>
|
113
|
+
<p id='_'>
|
114
|
+
Text
|
115
|
+
<bookmark id='id2'/>
|
116
|
+
</p>
|
117
|
+
<p id='_'>
|
118
|
+
Text
|
119
|
+
<bookmark id='id3'/>
|
120
|
+
</p>
|
121
|
+
</sections>
|
122
|
+
</standard-document>
|
119
123
|
OUTPUT
|
124
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
125
|
+
.to be_equivalent_to xmlpp(output)
|
120
126
|
end
|
121
127
|
|
122
128
|
it "processes the Asciidoctor::Standoc variant macros" do
|
123
|
-
|
129
|
+
input = <<~INPUT
|
124
130
|
#{ASCIIDOC_BLANK_HDR}
|
125
131
|
== lang:en[English] lang:fr-Latn[Français]
|
126
132
|
|
127
133
|
this lang:en[English] lang:fr-Latn[Français] section is lang:en[silly] lang:fr[fou]
|
128
134
|
|
129
135
|
INPUT
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
</
|
151
|
-
|
136
|
+
output = <<~OUTPUT
|
137
|
+
#{BLANK_HDR}
|
138
|
+
<sections>
|
139
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
140
|
+
<title>
|
141
|
+
<variant lang='en'>English</variant>
|
142
|
+
<variant lang='fr' script='Latn'>Français</variant>
|
143
|
+
</title>
|
144
|
+
<p id='_'>
|
145
|
+
this
|
146
|
+
<variant>
|
147
|
+
<variant lang='en'>English</variant>
|
148
|
+
<variant lang='fr' script='Latn'>Français</variant>
|
149
|
+
</variant>
|
150
|
+
section is
|
151
|
+
<variant>
|
152
|
+
<variant lang='en'>silly</variant>
|
153
|
+
<variant lang='fr'>fou</variant>
|
154
|
+
</variant>
|
155
|
+
</p>
|
156
|
+
</clause>
|
157
|
+
</sections>
|
158
|
+
</standard-document>
|
152
159
|
OUTPUT
|
160
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
161
|
+
.to be_equivalent_to xmlpp(output)
|
153
162
|
end
|
154
163
|
|
155
|
-
|
156
|
-
|
157
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
164
|
+
it "processes the Asciidoctor::Standoc concept macros" do
|
165
|
+
input = <<~INPUT
|
158
166
|
#{ASCIIDOC_BLANK_HDR}
|
159
167
|
{{clause1}}
|
168
|
+
term:[clause1]
|
160
169
|
{{clause1,w\[o\]rd}}
|
170
|
+
term:[clause1,w[o]rd]
|
161
171
|
{{clause1,w\[o\]rd,term}}
|
162
172
|
{{blah}}
|
173
|
+
term:[blah]
|
163
174
|
{{blah,word}}
|
164
|
-
|
165
|
-
{{blah,
|
166
|
-
{{blah,clause=3.1,word}}
|
167
|
-
{{blah,clause=3.1,word,term}}
|
168
|
-
{{blah,clause=3.1,figure=a}}
|
169
|
-
{{blah,clause=3.1,figure=a,word}}
|
170
|
-
{{blah,clause=3.1,figure=a,word,term}}
|
171
|
-
{{IEV:135-13-13}}
|
172
|
-
{{IEV:135-13-13,word}}
|
173
|
-
{{IEV:135-13-13,word,term}}
|
175
|
+
term:[blah,word]
|
176
|
+
{{blah,term,word}}
|
174
177
|
|
175
178
|
[[clause1]]
|
176
179
|
== Clause
|
177
180
|
Terms are defined here
|
181
|
+
INPUT
|
182
|
+
output = <<~OUTPUT
|
183
|
+
#{BLANK_HDR}
|
184
|
+
<preface>
|
185
|
+
<foreword id='_' obligation='informative'>
|
186
|
+
<title>Foreword</title>
|
187
|
+
<p id='_'>
|
188
|
+
<concept>
|
189
|
+
<strong>
|
190
|
+
term
|
191
|
+
<tt>clause1</tt>
|
192
|
+
not resolved via ID
|
193
|
+
<tt>clause1</tt>
|
194
|
+
</strong>
|
195
|
+
</concept>
|
196
|
+
<concept>
|
197
|
+
<strong>
|
198
|
+
term
|
199
|
+
<tt>clause1</tt>
|
200
|
+
not resolved via ID
|
201
|
+
<tt>clause1</tt>
|
202
|
+
</strong>
|
203
|
+
</concept>
|
204
|
+
<concept>
|
205
|
+
<strong>
|
206
|
+
term
|
207
|
+
<tt>clause1</tt>, display <tt>w[o]rd</tt>
|
208
|
+
not resolved via ID
|
209
|
+
<tt>clause1</tt>
|
210
|
+
</strong>
|
211
|
+
</concept>
|
212
|
+
<concept>
|
213
|
+
<strong>
|
214
|
+
term
|
215
|
+
<tt>clause1</tt>, display <tt>w[o]rd</tt>
|
216
|
+
not resolved via ID
|
217
|
+
<tt>clause1</tt>
|
218
|
+
</strong>
|
219
|
+
</concept>
|
220
|
+
<concept>
|
221
|
+
<strong>
|
222
|
+
term
|
223
|
+
<tt>clause1</tt>, display <tt>w[o]rd</tt>
|
224
|
+
not resolved via ID
|
225
|
+
<tt>clause1</tt>
|
226
|
+
</strong>
|
227
|
+
</concept>
|
228
|
+
<concept>
|
229
|
+
<strong>
|
230
|
+
term
|
231
|
+
<tt>blah</tt>
|
232
|
+
not resolved via ID
|
233
|
+
<tt>blah</tt>
|
234
|
+
</strong>
|
235
|
+
</concept>
|
236
|
+
<concept>
|
237
|
+
<strong>
|
238
|
+
term
|
239
|
+
<tt>blah</tt>
|
240
|
+
not resolved via ID
|
241
|
+
<tt>blah</tt>
|
242
|
+
</strong>
|
243
|
+
</concept>
|
244
|
+
<concept>
|
245
|
+
<strong>
|
246
|
+
term
|
247
|
+
<tt>blah</tt>
|
248
|
+
, display
|
249
|
+
<tt>word</tt>
|
250
|
+
not resolved via ID
|
251
|
+
<tt>blah</tt>
|
252
|
+
</strong>
|
253
|
+
</concept>
|
254
|
+
<concept>
|
255
|
+
<strong>
|
256
|
+
term
|
257
|
+
<tt>blah</tt>
|
258
|
+
, display
|
259
|
+
<tt>word</tt>
|
260
|
+
not resolved via ID
|
261
|
+
<tt>blah</tt>
|
262
|
+
</strong>
|
263
|
+
</concept>
|
264
|
+
<concept>
|
265
|
+
<strong>
|
266
|
+
term
|
267
|
+
<tt>blah</tt>
|
268
|
+
, display
|
269
|
+
<tt>term</tt>
|
270
|
+
not resolved via ID
|
271
|
+
<tt>blah</tt>
|
272
|
+
</strong>
|
273
|
+
</concept>
|
274
|
+
</p>
|
275
|
+
</foreword>
|
276
|
+
</preface>
|
277
|
+
<sections>
|
278
|
+
<clause id='clause1' inline-header='false' obligation='normative'>
|
279
|
+
<title>Clause</title>
|
280
|
+
<p id='_'>Terms are defined here</p>
|
281
|
+
</clause>
|
282
|
+
</sections>
|
283
|
+
</standard-document>
|
284
|
+
OUTPUT
|
285
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
286
|
+
.to be_equivalent_to xmlpp(output)
|
287
|
+
end
|
288
|
+
|
289
|
+
it "processes the concept macros with xrefs" do
|
290
|
+
input = <<~INPUT
|
291
|
+
#{ASCIIDOC_BLANK_HDR}
|
292
|
+
{{<<clause1>>}}
|
293
|
+
{{<<clause1>>,w\[o\]rd}}
|
294
|
+
{{<<clause1>>,term,w\[o\]rd}}
|
295
|
+
{{<<clause1>>,term,w\[o\]rd,Clause #1}}
|
296
|
+
|
297
|
+
[[clause1]]
|
298
|
+
== Clause
|
299
|
+
Terms are defined here
|
300
|
+
INPUT
|
301
|
+
output = <<~OUTPUT
|
302
|
+
#{BLANK_HDR}
|
303
|
+
<preface>
|
304
|
+
<foreword id='_' obligation='informative'>
|
305
|
+
<title>Foreword</title>
|
306
|
+
<p id='_'>
|
307
|
+
<concept>
|
308
|
+
<xref target='clause1'/>
|
309
|
+
</concept>
|
310
|
+
<concept>
|
311
|
+
<refterm>w[o]rd</refterm>
|
312
|
+
<renderterm>w[o]rd</renderterm>
|
313
|
+
<xref target='clause1'/>
|
314
|
+
</concept>
|
315
|
+
<concept>
|
316
|
+
<refterm>term</refterm>
|
317
|
+
<renderterm>w[o]rd</renderterm>
|
318
|
+
<xref target='clause1'/>
|
319
|
+
</concept>
|
320
|
+
<concept>
|
321
|
+
<refterm>term</refterm>
|
322
|
+
<renderterm>w[o]rd</renderterm>
|
323
|
+
<xref target='clause1'>Clause #1</xref>
|
324
|
+
</concept>
|
325
|
+
</p>
|
326
|
+
</foreword>
|
327
|
+
</preface>
|
328
|
+
<sections>
|
329
|
+
<clause id='clause1' inline-header='false' obligation='normative'>
|
330
|
+
<title>Clause</title>
|
331
|
+
<p id='_'>Terms are defined here</p>
|
332
|
+
</clause>
|
333
|
+
</sections>
|
334
|
+
</standard-document>
|
335
|
+
OUTPUT
|
336
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
337
|
+
.to be_equivalent_to xmlpp(output)
|
338
|
+
end
|
339
|
+
|
340
|
+
it "processes the concept macros with erefs" do
|
341
|
+
input = <<~INPUT
|
342
|
+
#{ASCIIDOC_BLANK_HDR}
|
343
|
+
{{<<blah>>}}
|
344
|
+
{{<<blah>>,word}}
|
345
|
+
{{<<blah>>,term,word}}
|
346
|
+
{{<<blah>>,term,word,Clause #1}}
|
347
|
+
{{<<blah,clause=3.1>>}}
|
348
|
+
{{<<blah,clause=3.1>>,word}}
|
349
|
+
{{<<blah,clause=3.1>>,term,word}}
|
350
|
+
{{<<blah,clause=3.1,figure=a>>}}
|
351
|
+
{{<<blah,clause=3.1,figure=a>>,word}}
|
352
|
+
{{<<blah,clause=3.1,figure=a>>,term,word,Clause #1}}
|
178
353
|
|
179
354
|
[bibliography]
|
180
355
|
== Bibliography
|
181
356
|
* [[[blah,blah]]] _Blah_
|
182
|
-
INPUT
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
<
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
</
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
357
|
+
INPUT
|
358
|
+
output = <<~OUTPUT
|
359
|
+
#{BLANK_HDR}
|
360
|
+
<preface>
|
361
|
+
<foreword id='_' obligation='informative'>
|
362
|
+
<title>Foreword</title>
|
363
|
+
<p id='_'>
|
364
|
+
<concept>
|
365
|
+
<eref bibitemid='blah'/>
|
366
|
+
</concept>
|
367
|
+
<concept>
|
368
|
+
<refterm>word</refterm>
|
369
|
+
<renderterm>word</renderterm>
|
370
|
+
<eref bibitemid='blah'/>
|
371
|
+
</concept>
|
372
|
+
<concept>
|
373
|
+
<refterm>term</refterm>
|
374
|
+
<renderterm>word</renderterm>
|
375
|
+
<eref bibitemid='blah'/>
|
376
|
+
</concept>
|
377
|
+
<concept>
|
378
|
+
<refterm>term</refterm>
|
379
|
+
<renderterm>word</renderterm>
|
380
|
+
<eref bibitemid='blah'>Clause #1</eref>
|
381
|
+
</concept>
|
382
|
+
<concept>
|
383
|
+
<eref bibitemid='blah'>
|
384
|
+
<localityStack>
|
385
|
+
<locality type='clause'>
|
386
|
+
<referenceFrom>3.1</referenceFrom>
|
387
|
+
</locality>
|
388
|
+
</localityStack>
|
389
|
+
</eref>
|
390
|
+
</concept>
|
391
|
+
<concept>
|
392
|
+
<refterm>word</refterm>
|
393
|
+
<renderterm>word</renderterm>
|
394
|
+
<eref bibitemid='blah'>
|
395
|
+
<localityStack>
|
396
|
+
<locality type='clause'>
|
397
|
+
<referenceFrom>3.1</referenceFrom>
|
398
|
+
</locality>
|
399
|
+
</localityStack>
|
400
|
+
</eref>
|
401
|
+
</concept>
|
402
|
+
<concept>
|
403
|
+
<refterm>term</refterm>
|
404
|
+
<renderterm>word</renderterm>
|
405
|
+
<eref bibitemid='blah'>
|
406
|
+
<localityStack>
|
407
|
+
<locality type='clause'>
|
408
|
+
<referenceFrom>3.1</referenceFrom>
|
409
|
+
</locality>
|
410
|
+
</localityStack>
|
411
|
+
</eref>
|
412
|
+
</concept>
|
413
|
+
<concept>
|
414
|
+
<eref bibitemid='blah'>
|
415
|
+
<localityStack>
|
416
|
+
<locality type='clause'>
|
417
|
+
<referenceFrom>3.1</referenceFrom>
|
418
|
+
</locality>
|
419
|
+
<locality type='figure'>
|
420
|
+
<referenceFrom>a</referenceFrom>
|
421
|
+
</locality>
|
422
|
+
</localityStack>
|
423
|
+
</eref>
|
424
|
+
</concept>
|
425
|
+
<concept>
|
426
|
+
<refterm>word</refterm>
|
427
|
+
<renderterm>word</renderterm>
|
428
|
+
<eref bibitemid='blah'>
|
429
|
+
<localityStack>
|
430
|
+
<locality type='clause'>
|
431
|
+
<referenceFrom>3.1</referenceFrom>
|
432
|
+
</locality>
|
433
|
+
<locality type='figure'>
|
434
|
+
<referenceFrom>a</referenceFrom>
|
435
|
+
</locality>
|
436
|
+
</localityStack>
|
437
|
+
</eref>
|
438
|
+
</concept>
|
439
|
+
<concept>
|
440
|
+
<refterm>term</refterm>
|
441
|
+
<renderterm>word</renderterm>
|
442
|
+
<eref bibitemid='blah'>
|
443
|
+
<localityStack>
|
444
|
+
<locality type='clause'>
|
445
|
+
<referenceFrom>3.1</referenceFrom>
|
446
|
+
</locality>
|
447
|
+
<locality type='figure'>
|
448
|
+
<referenceFrom>a</referenceFrom>
|
449
|
+
</locality>
|
450
|
+
</localityStack>
|
451
|
+
Clause #1
|
452
|
+
</eref>
|
453
|
+
</concept>
|
454
|
+
</p>
|
455
|
+
</foreword>
|
456
|
+
</preface>
|
457
|
+
<sections> </sections>
|
458
|
+
<bibliography>
|
459
|
+
<references id='_' normative='false' obligation='informative'>
|
460
|
+
<title>Bibliography</title>
|
461
|
+
<bibitem id='blah'>
|
462
|
+
<formattedref format='application/x-isodoc+xml'>
|
463
|
+
<em>Blah</em>
|
464
|
+
</formattedref>
|
465
|
+
<docidentifier>blah</docidentifier>
|
466
|
+
</bibitem>
|
467
|
+
</references>
|
468
|
+
</bibliography>
|
469
|
+
</standard-document>
|
470
|
+
OUTPUT
|
471
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
472
|
+
.to be_equivalent_to xmlpp(output)
|
473
|
+
end
|
474
|
+
|
475
|
+
it "processes the concept macros with termbase" do
|
476
|
+
input = <<~INPUT
|
477
|
+
#{ASCIIDOC_BLANK_HDR}
|
478
|
+
{{<<IEV:135-13-13>>}}
|
479
|
+
{{<<IEV:135-13-13>>,word}}
|
480
|
+
{{<<IEV:135-13-13>>,term,word}}
|
481
|
+
{{<<IEV:135-13-13>>,term,word,Clause #1}}
|
482
|
+
INPUT
|
483
|
+
output = <<~OUTPUT
|
484
|
+
#{BLANK_HDR}
|
485
|
+
<sections>
|
486
|
+
<p id='_'>
|
487
|
+
<concept>
|
488
|
+
<termref base='IEV' target='135-13-13'/>
|
489
|
+
</concept>
|
490
|
+
<concept>
|
491
|
+
<refterm>word</refterm>
|
492
|
+
<renderterm>word</renderterm>
|
493
|
+
<termref base='IEV' target='135-13-13'/>
|
494
|
+
</concept>
|
495
|
+
<concept>
|
496
|
+
<refterm>term</refterm>
|
497
|
+
<renderterm>word</renderterm>
|
498
|
+
<termref base='IEV' target='135-13-13'/>
|
499
|
+
</concept>
|
500
|
+
<concept>
|
501
|
+
<refterm>term</refterm>
|
502
|
+
<renderterm>word</renderterm>
|
503
|
+
<termref base='IEV' target='135-13-13'>Clause #1</termref>
|
504
|
+
</concept>
|
505
|
+
</p>
|
506
|
+
</sections>
|
507
|
+
</standard-document>
|
508
|
+
OUTPUT
|
509
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
510
|
+
.to be_equivalent_to xmlpp(output)
|
511
|
+
end
|
305
512
|
|
306
513
|
it "processes the TODO custom admonition" do
|
307
|
-
|
514
|
+
input = <<~INPUT
|
308
515
|
#{ASCIIDOC_BLANK_HDR}
|
309
516
|
TODO: Note1
|
310
517
|
|
@@ -316,160 +523,175 @@ OUTPUT
|
|
316
523
|
[TODO]
|
317
524
|
Note3
|
318
525
|
INPUT
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
526
|
+
output = <<~OUTPUT
|
527
|
+
#{BLANK_HDR}
|
528
|
+
<sections><review reviewer="(Unknown)" id="_" date="#{Date.today}T00:00:00Z">
|
529
|
+
<p id="_"/>
|
530
|
+
</review>
|
531
|
+
<review reviewer="(Unknown)" id="_" date="#{Date.today}T00:00:00Z">
|
532
|
+
<p id="_">Note2</p>
|
533
|
+
</review>
|
534
|
+
<review reviewer="(Unknown)" id="_" date="#{Date.today}T00:00:00Z">
|
535
|
+
<p id="_">Note3</p>
|
536
|
+
</review></sections>
|
537
|
+
</standard-document>
|
330
538
|
OUTPUT
|
539
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
540
|
+
.to be_equivalent_to xmlpp(output)
|
331
541
|
end
|
332
542
|
|
333
543
|
it "generates pseudocode examples, with formatting and initial indentation" do
|
334
|
-
|
335
|
-
|
544
|
+
input = <<~INPUT
|
545
|
+
#{ASCIIDOC_BLANK_HDR}
|
336
546
|
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
547
|
+
[pseudocode,subsequence="A",number="3",keep-with-next=true,keep-lines-together=true]
|
548
|
+
[%unnumbered]
|
549
|
+
====
|
550
|
+
*A* +
|
551
|
+
[smallcap]#B#
|
342
552
|
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
<
|
350
|
-
|
351
|
-
<
|
352
|
-
</
|
353
|
-
</
|
354
|
-
|
355
|
-
|
553
|
+
_C_
|
554
|
+
====
|
555
|
+
INPUT
|
556
|
+
output = <<~OUTPUT
|
557
|
+
#{BLANK_HDR}
|
558
|
+
<sections>
|
559
|
+
<figure id="_" subsequence='A' class="pseudocode" unnumbered="true" number="3" keep-with-next="true" keep-lines-together="true">
|
560
|
+
<p id="_"> <strong>A</strong><br/>
|
561
|
+
<smallcap>B</smallcap></p>
|
562
|
+
<p id="_"> <em>C</em></p></figure>
|
563
|
+
</sections>
|
564
|
+
</standard-document>
|
565
|
+
OUTPUT
|
566
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
567
|
+
.to be_equivalent_to xmlpp(output)
|
568
|
+
end
|
356
569
|
|
357
|
-
|
358
|
-
|
359
|
-
|
570
|
+
it "supplies line breaks in pseudocode" do
|
571
|
+
input = <<~INPUT
|
572
|
+
#{ASCIIDOC_BLANK_HDR}
|
360
573
|
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
574
|
+
[pseudocode]
|
575
|
+
====
|
576
|
+
A
|
577
|
+
B
|
365
578
|
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
<
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
</
|
385
|
-
</
|
386
|
-
|
387
|
-
|
579
|
+
D
|
580
|
+
E
|
581
|
+
====
|
582
|
+
INPUT
|
583
|
+
output = <<~OUTPUT
|
584
|
+
#{BLANK_HDR}
|
585
|
+
<sections>
|
586
|
+
<figure id='_' class='pseudocode'>
|
587
|
+
<p id='_'>
|
588
|
+
A
|
589
|
+
<br/>
|
590
|
+
B
|
591
|
+
</p>
|
592
|
+
<p id='_'>
|
593
|
+
D
|
594
|
+
<br/>
|
595
|
+
E
|
596
|
+
</p>
|
597
|
+
</figure>
|
598
|
+
</sections>
|
599
|
+
</standard-document>
|
600
|
+
OUTPUT
|
601
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
602
|
+
.to be_equivalent_to xmlpp(output)
|
603
|
+
end
|
388
604
|
|
389
|
-
|
390
|
-
|
391
|
-
|
605
|
+
it "skips embedded blocks when supplying line breaks in pseudocode" do
|
606
|
+
input = <<~INPUT
|
607
|
+
#{ASCIIDOC_BLANK_HDR}
|
392
608
|
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
<
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
<mfrac>
|
416
|
-
<mrow>
|
417
|
-
<mn>1</mn>
|
418
|
-
</mrow>
|
419
|
-
<mrow>
|
420
|
-
<mi>v</mi>
|
421
|
-
</mrow>
|
422
|
-
</mfrac>
|
423
|
-
<munderover>
|
424
|
-
<mrow>
|
425
|
-
<mo>∑</mo>
|
426
|
-
</mrow>
|
427
|
-
<mrow>
|
428
|
-
<mrow>
|
429
|
-
<mi>i</mi>
|
609
|
+
[pseudocode]
|
610
|
+
====
|
611
|
+
[stem]
|
612
|
+
++++
|
613
|
+
bar X' = (1)/(v) sum_(i = 1)^(v) t_(i)
|
614
|
+
++++
|
615
|
+
====
|
616
|
+
INPUT
|
617
|
+
output = <<~OUTPUT
|
618
|
+
#{BLANK_HDR}
|
619
|
+
<sections>
|
620
|
+
<figure id='_' class='pseudocode'>
|
621
|
+
<formula id='_'>
|
622
|
+
<stem type='MathML'>
|
623
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
624
|
+
<mover accent="true">
|
625
|
+
<mrow>
|
626
|
+
<mi>X</mi>
|
627
|
+
</mrow>
|
628
|
+
<mo>¯</mo>
|
629
|
+
</mover>
|
630
|
+
<mo>′</mo>
|
430
631
|
<mo>=</mo>
|
431
|
-
<
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
</
|
452
|
-
|
453
|
-
|
632
|
+
<mfrac>
|
633
|
+
<mrow>
|
634
|
+
<mn>1</mn>
|
635
|
+
</mrow>
|
636
|
+
<mrow>
|
637
|
+
<mi>v</mi>
|
638
|
+
</mrow>
|
639
|
+
</mfrac>
|
640
|
+
<munderover>
|
641
|
+
<mrow>
|
642
|
+
<mo>∑</mo>
|
643
|
+
</mrow>
|
644
|
+
<mrow>
|
645
|
+
<mrow>
|
646
|
+
<mi>i</mi>
|
647
|
+
<mo>=</mo>
|
648
|
+
<mn>1</mn>
|
649
|
+
</mrow>
|
650
|
+
</mrow>
|
651
|
+
<mrow>
|
652
|
+
<mi>v</mi>
|
653
|
+
</mrow>
|
654
|
+
</munderover>
|
655
|
+
<msub>
|
656
|
+
<mrow>
|
657
|
+
<mi>t</mi>
|
658
|
+
</mrow>
|
659
|
+
<mrow>
|
660
|
+
<mi>i</mi>
|
661
|
+
</mrow>
|
662
|
+
</msub>
|
663
|
+
</math>
|
664
|
+
</stem>
|
665
|
+
</formula>
|
666
|
+
</figure>
|
667
|
+
</sections>
|
668
|
+
</standard-document>
|
669
|
+
OUTPUT
|
670
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
671
|
+
.to be_equivalent_to xmlpp(output)
|
672
|
+
end
|
454
673
|
|
455
674
|
it "processes the Ruby markups" do
|
456
|
-
|
675
|
+
input = <<~INPUT
|
457
676
|
#{ASCIIDOC_BLANK_HDR}
|
458
677
|
|
459
678
|
ruby:楽聖少女[がくせいしょうじょ]
|
460
679
|
INPUT
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
680
|
+
output = <<~OUTPUT
|
681
|
+
#{BLANK_HDR}
|
682
|
+
<sections>
|
683
|
+
<p id="_">
|
684
|
+
<ruby>楽聖少女<rp>(</rp><rt>がくせいしょうじょ</rt><rp>)</rp></ruby>
|
685
|
+
</p>
|
686
|
+
</sections>
|
687
|
+
</standard-document>
|
468
688
|
OUTPUT
|
689
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
690
|
+
.to be_equivalent_to xmlpp(output)
|
469
691
|
end
|
470
692
|
|
471
693
|
it "processes the footnoteblock macro" do
|
472
|
-
|
694
|
+
input = <<~INPUT
|
473
695
|
#{ASCIIDOC_BLANK_HDR}
|
474
696
|
|
475
697
|
footnoteblock:[id1]
|
@@ -488,44 +710,47 @@ OUTPUT
|
|
488
710
|
* C
|
489
711
|
--
|
490
712
|
INPUT
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
</
|
521
|
-
|
522
|
-
|
523
|
-
|
713
|
+
output = <<~OUTPUT
|
714
|
+
#{BLANK_HDR}
|
715
|
+
<sections>
|
716
|
+
<p id="_">
|
717
|
+
<fn reference='1'>
|
718
|
+
<table id='_'>
|
719
|
+
<thead>
|
720
|
+
<tr>
|
721
|
+
<th valign='top' align='left'>a</th>
|
722
|
+
<th valign='top' align='left'>b</th>
|
723
|
+
</tr>
|
724
|
+
</thead>
|
725
|
+
<tbody>
|
726
|
+
<tr>
|
727
|
+
<td valign='top' align='left'>c</td>
|
728
|
+
<td valign='top' align='left'>d</td>
|
729
|
+
</tr>
|
730
|
+
</tbody>
|
731
|
+
</table>
|
732
|
+
<ul id='_'>
|
733
|
+
<li>
|
734
|
+
<p id='_'>A</p>
|
735
|
+
</li>
|
736
|
+
<li>
|
737
|
+
<p id='_'>B</p>
|
738
|
+
</li>
|
739
|
+
<li>
|
740
|
+
<p id='_'>C</p>
|
741
|
+
</li>
|
742
|
+
</ul>
|
743
|
+
</fn>
|
744
|
+
</p>
|
745
|
+
</sections>
|
746
|
+
</standard-document>
|
524
747
|
OUTPUT
|
748
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
749
|
+
.to be_equivalent_to xmlpp(output)
|
525
750
|
end
|
526
751
|
|
527
|
-
|
528
|
-
|
752
|
+
it "processes the footnoteblock macro with failed reference" do
|
753
|
+
input = <<~INPUT
|
529
754
|
#{ASCIIDOC_BLANK_HDR}
|
530
755
|
|
531
756
|
footnoteblock:[id1]
|
@@ -544,60 +769,168 @@ OUTPUT
|
|
544
769
|
* C
|
545
770
|
--
|
546
771
|
INPUT
|
547
|
-
|
772
|
+
output = <<~OUTPUT
|
773
|
+
#{BLANK_HDR}
|
774
|
+
<sections>
|
775
|
+
<p id='_'>
|
776
|
+
<fn reference='1'>[ERROR]</fn>
|
777
|
+
</p>
|
778
|
+
<note id='id2'>
|
779
|
+
<table id='_'>
|
780
|
+
<thead>
|
781
|
+
<tr>
|
782
|
+
<th valign='top' align='left'>a</th>
|
783
|
+
<th valign='top' align='left'>b</th>
|
784
|
+
</tr>
|
785
|
+
</thead>
|
786
|
+
<tbody>
|
787
|
+
<tr>
|
788
|
+
<td valign='top' align='left'>c</td>
|
789
|
+
<td valign='top' align='left'>d</td>
|
790
|
+
</tr>
|
791
|
+
</tbody>
|
792
|
+
</table>
|
793
|
+
<ul id='_'>
|
794
|
+
<li>
|
795
|
+
<p id='_'>A</p>
|
796
|
+
</li>
|
797
|
+
<li>
|
798
|
+
<p id='_'>B</p>
|
799
|
+
</li>
|
800
|
+
<li>
|
801
|
+
<p id='_'>C</p>
|
802
|
+
</li>
|
803
|
+
</ul>
|
804
|
+
</note>
|
805
|
+
</sections>
|
806
|
+
</standard-document>
|
807
|
+
OUTPUT
|
808
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
809
|
+
.to be_equivalent_to xmlpp(output)
|
810
|
+
end
|
811
|
+
|
812
|
+
it "processes input form macros" do
|
813
|
+
input = <<~INPUT
|
814
|
+
#{ASCIIDOC_BLANK_HDR}
|
815
|
+
|
816
|
+
[form,id=N0,name=N1,action="/action_page.php"]
|
817
|
+
--
|
818
|
+
label:fname[First name:] +
|
819
|
+
input:text[id=fname,name=fname] +
|
820
|
+
label:lname[Last name:] +
|
821
|
+
input:text[id=lname,name=lname] +
|
822
|
+
label:pwd[Password:] +
|
823
|
+
input:password[id=pwd,name=pwd] +
|
824
|
+
input:radio[id=male,name=gender,value=male]
|
825
|
+
label:male[Male] +
|
826
|
+
input:radio[id=female,name=gender,value=female]
|
827
|
+
label:female[Female] +
|
828
|
+
input:radio[id=other,name=gender,value=other]
|
829
|
+
label:other[Other] +
|
830
|
+
input:checkbox[id=vehicle1,name=vehicle1,value=Bike,checked=true]
|
831
|
+
label:vehicle1[I have a bike] +
|
832
|
+
input:checkbox[id=vehicle2,name=vehicle2,value=Car]
|
833
|
+
label:vehicle2[I have a car] +
|
834
|
+
input:checkbox[id=vehicle3,name=vehicle3,value=Boat]
|
835
|
+
label:vehicle3[I have a boat] +
|
836
|
+
input:date[id=birthday,name=birthday] +
|
837
|
+
label:myfile[Select a file:]
|
838
|
+
input:file[id=myfile,name=myfile] +
|
839
|
+
label:cars[Select a car:] +
|
840
|
+
select:[id=cars,name=cars,value=fiat,size=4,disabled=true,multiple=true]
|
841
|
+
option:[Volvo,value=volvo,disabled=true]
|
842
|
+
option:[Saab,value=saab]
|
843
|
+
option:[Fiat,value=fiat]
|
844
|
+
option:[Audi,value=audi]
|
845
|
+
textarea:[id=t1,name=message,rows=10,cols=30,value="The cat was playing in the garden."]
|
846
|
+
input:button[value="Click Me!"]
|
847
|
+
input:button[]
|
848
|
+
input:submit[value="Submit"]
|
849
|
+
--
|
850
|
+
INPUT
|
851
|
+
output = <<~OUTPUT
|
852
|
+
#{BLANK_HDR}
|
548
853
|
<sections>
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
|
567
|
-
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
|
572
|
-
|
573
|
-
|
574
|
-
|
575
|
-
|
576
|
-
|
577
|
-
|
578
|
-
|
579
|
-
|
580
|
-
|
854
|
+
<form id='_' name='N1' action='/action_page.php'>
|
855
|
+
<p id='_'>
|
856
|
+
<label for='fname'>First name:</label>
|
857
|
+
<br/>
|
858
|
+
<input type='text' id='fname' name='fname'/>
|
859
|
+
<br/>
|
860
|
+
<label for='lname'>Last name:</label>
|
861
|
+
<br/>
|
862
|
+
<input type='text' id='lname' name='lname'/>
|
863
|
+
<br/>
|
864
|
+
<label for='pwd'>Password:</label>
|
865
|
+
<br/>
|
866
|
+
<input type='password' id='pwd' name='pwd'/>
|
867
|
+
<br/>
|
868
|
+
<input type='radio' id='male' name='gender' value='male'/>
|
869
|
+
<label for='male'>Male</label>
|
870
|
+
<br/>
|
871
|
+
<input type='radio' id='female' name='gender' value='female'/>
|
872
|
+
<label for='female'>Female</label>
|
873
|
+
<br/>
|
874
|
+
<input type='radio' id='other' name='gender' value='other'/>
|
875
|
+
<label for='other'>Other</label>
|
876
|
+
<br/>
|
877
|
+
<input type='checkbox' id='vehicle1' name='vehicle1' value='Bike' checked='true'/>
|
878
|
+
<label for='vehicle1'>I have a bike</label>
|
879
|
+
<br/>
|
880
|
+
<input type='checkbox' id='vehicle2' name='vehicle2' value='Car'/>
|
881
|
+
<label for='vehicle2'>I have a car</label>
|
882
|
+
<br/>
|
883
|
+
<input type='checkbox' id='vehicle3' name='vehicle3' value='Boat'/>
|
884
|
+
<label for='vehicle3'>I have a boat</label>
|
885
|
+
<br/>
|
886
|
+
<input type='date' id='birthday' name='birthday'/>
|
887
|
+
<br/>
|
888
|
+
<label for='myfile'>Select a file:</label>
|
889
|
+
<input type='file' id='myfile' name='myfile'/>
|
890
|
+
<br/>
|
891
|
+
<label for='cars'>Select a car:</label>
|
892
|
+
<br/>
|
893
|
+
<select id='cars' name='cars' size='4' disabled='true' multiple='true' value='fiat'>
|
894
|
+
<option disabled='true' value='volvo'/>
|
895
|
+
<option value='saab'/>
|
896
|
+
<option value='fiat'/>
|
897
|
+
<option value='audi'/>
|
898
|
+
</select>
|
899
|
+
<textarea id='t1' name='message' rows='10' cols='30' value='The cat was playing in the garden.'/>
|
900
|
+
<input type='button' value='Click Me!'/>
|
901
|
+
<input type='button'/>
|
902
|
+
<input type='submit' value='Submit'/>
|
903
|
+
</p>
|
904
|
+
</form>
|
905
|
+
</sections>
|
906
|
+
</standard-document>
|
581
907
|
OUTPUT
|
908
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
909
|
+
.to be_equivalent_to xmlpp(output)
|
582
910
|
end
|
583
911
|
|
584
|
-
|
912
|
+
describe "term inline macros" do
|
585
913
|
subject(:convert) do
|
586
914
|
xmlpp(
|
587
915
|
strip_guid(
|
588
916
|
Asciidoctor.convert(
|
589
|
-
input,
|
917
|
+
input, *OPTIONS
|
918
|
+
),
|
919
|
+
),
|
920
|
+
)
|
590
921
|
end
|
591
922
|
let(:input) do
|
592
923
|
<<~XML
|
593
924
|
#{ASCIIDOC_BLANK_HDR}
|
594
925
|
== Terms and Definitions
|
595
926
|
|
596
|
-
===
|
927
|
+
=== name
|
597
928
|
|
598
929
|
== Main
|
599
930
|
|
600
931
|
term:[name,name2] is a term
|
932
|
+
|
933
|
+
{{name,name2}} is a term
|
601
934
|
XML
|
602
935
|
end
|
603
936
|
let(:output) do
|
@@ -607,17 +940,27 @@ OUTPUT
|
|
607
940
|
<terms id='_' obligation='normative'>
|
608
941
|
<title>Terms and definitions</title>
|
609
942
|
<p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
|
610
|
-
<term id='term-
|
611
|
-
<preferred>
|
943
|
+
<term id='term-name'>
|
944
|
+
<preferred>name</preferred>
|
612
945
|
</term>
|
613
946
|
</terms>
|
614
947
|
<clause id='_' inline-header='false' obligation='normative'>
|
615
948
|
<title>Main</title>
|
616
949
|
<p id='_'>
|
617
|
-
|
618
|
-
|
619
|
-
<
|
620
|
-
|
950
|
+
<concept>
|
951
|
+
<refterm>name</refterm>
|
952
|
+
<renderterm>name2</renderterm>
|
953
|
+
<xref target='term-name'/>
|
954
|
+
</concept>
|
955
|
+
is a term
|
956
|
+
</p>
|
957
|
+
<p id='_'>
|
958
|
+
<concept>
|
959
|
+
<refterm>name</refterm>
|
960
|
+
<renderterm>name2</renderterm>
|
961
|
+
<xref target='term-name'/>
|
962
|
+
</concept>
|
963
|
+
is a term
|
621
964
|
</p>
|
622
965
|
</clause>
|
623
966
|
</sections>
|
@@ -625,11 +968,11 @@ OUTPUT
|
|
625
968
|
XML
|
626
969
|
end
|
627
970
|
|
628
|
-
it
|
971
|
+
it "converts macro into the correct xml" do
|
629
972
|
expect(convert).to(be_equivalent_to(xmlpp(output)))
|
630
973
|
end
|
631
974
|
|
632
|
-
context
|
975
|
+
context "default params" do
|
633
976
|
let(:input) do
|
634
977
|
<<~XML
|
635
978
|
#{ASCIIDOC_BLANK_HDR}
|
@@ -641,6 +984,8 @@ OUTPUT
|
|
641
984
|
== Main
|
642
985
|
|
643
986
|
term:[name] is a term
|
987
|
+
|
988
|
+
{{name}} is a term
|
644
989
|
XML
|
645
990
|
end
|
646
991
|
let(:output) do
|
@@ -657,10 +1002,20 @@ OUTPUT
|
|
657
1002
|
<clause id='_' inline-header='false' obligation='normative'>
|
658
1003
|
<title>Main</title>
|
659
1004
|
<p id='_'>
|
660
|
-
|
661
|
-
|
662
|
-
|
663
|
-
|
1005
|
+
<concept>
|
1006
|
+
<refterm>name</refterm>
|
1007
|
+
<renderterm>name</renderterm>
|
1008
|
+
<xref target='term-name'/>
|
1009
|
+
</concept>
|
1010
|
+
is a term
|
1011
|
+
</p>
|
1012
|
+
<p id='_'>
|
1013
|
+
<concept>
|
1014
|
+
<refterm>name</refterm>
|
1015
|
+
<renderterm>name</renderterm>
|
1016
|
+
<xref target='term-name'/>
|
1017
|
+
</concept>
|
1018
|
+
is a term
|
664
1019
|
</p>
|
665
1020
|
</clause>
|
666
1021
|
</sections>
|
@@ -668,12 +1023,12 @@ OUTPUT
|
|
668
1023
|
XML
|
669
1024
|
end
|
670
1025
|
|
671
|
-
it
|
1026
|
+
it "uses `name` as termref name" do
|
672
1027
|
expect(convert).to(be_equivalent_to(xmlpp(output)))
|
673
1028
|
end
|
674
1029
|
end
|
675
1030
|
|
676
|
-
|
1031
|
+
context "multiply exising ids in document" do
|
677
1032
|
let(:input) do
|
678
1033
|
<<~XML
|
679
1034
|
#{ASCIIDOC_BLANK_HDR}
|
@@ -693,6 +1048,8 @@ OUTPUT
|
|
693
1048
|
|
694
1049
|
term:[name] is a term
|
695
1050
|
term:[name2] is a term
|
1051
|
+
{{name}} is a term
|
1052
|
+
{{name2}} is a term
|
696
1053
|
XML
|
697
1054
|
end
|
698
1055
|
let(:output) do
|
@@ -716,14 +1073,30 @@ OUTPUT
|
|
716
1073
|
<clause id='term-name2' inline-header='false' obligation='normative'>
|
717
1074
|
<title>Second</title>
|
718
1075
|
<p id='_'>
|
719
|
-
|
720
|
-
|
721
|
-
|
722
|
-
|
723
|
-
|
724
|
-
|
725
|
-
|
726
|
-
|
1076
|
+
<concept>
|
1077
|
+
<refterm>name</refterm>
|
1078
|
+
<renderterm>name</renderterm>
|
1079
|
+
<xref target='term-name-1'/>
|
1080
|
+
</concept>
|
1081
|
+
is a term
|
1082
|
+
<concept>
|
1083
|
+
<refterm>name2</refterm>
|
1084
|
+
<renderterm>name2</renderterm>
|
1085
|
+
<xref target='term-name2-1'/>
|
1086
|
+
</concept>
|
1087
|
+
is a term
|
1088
|
+
<concept>
|
1089
|
+
<refterm>name</refterm>
|
1090
|
+
<renderterm>name</renderterm>
|
1091
|
+
<xref target='term-name-1'/>
|
1092
|
+
</concept>
|
1093
|
+
is a term
|
1094
|
+
<concept>
|
1095
|
+
<refterm>name2</refterm>
|
1096
|
+
<renderterm>name2</renderterm>
|
1097
|
+
<xref target='term-name2-1'/>
|
1098
|
+
</concept>
|
1099
|
+
is a term
|
727
1100
|
</p>
|
728
1101
|
</clause>
|
729
1102
|
</sections>
|
@@ -731,12 +1104,12 @@ OUTPUT
|
|
731
1104
|
XML
|
732
1105
|
end
|
733
1106
|
|
734
|
-
it
|
1107
|
+
it "generates unique ids which do not match existing ids" do
|
735
1108
|
expect(convert).to(be_equivalent_to(xmlpp(output)))
|
736
1109
|
end
|
737
1110
|
end
|
738
1111
|
|
739
|
-
|
1112
|
+
context "when missing actual ref" do
|
740
1113
|
let(:input) do
|
741
1114
|
<<~XML
|
742
1115
|
#{ASCIIDOC_BLANK_HDR}
|
@@ -755,49 +1128,96 @@ OUTPUT
|
|
755
1128
|
term:[name identity] is a term
|
756
1129
|
|
757
1130
|
Moreover, term:[missing] is a term
|
1131
|
+
|
1132
|
+
|
1133
|
+
{{name check}} is a term
|
1134
|
+
|
1135
|
+
{{name identity}} is a term
|
1136
|
+
|
1137
|
+
Moreover, {{missing}} is a term
|
758
1138
|
XML
|
759
1139
|
end
|
760
1140
|
let(:output) do
|
761
1141
|
<<~XML
|
762
1142
|
#{BLANK_HDR}
|
763
|
-
|
764
|
-
|
765
|
-
|
766
|
-
|
767
|
-
|
768
|
-
|
769
|
-
</term>
|
770
|
-
|
771
|
-
|
772
|
-
|
773
|
-
|
774
|
-
|
775
|
-
|
776
|
-
|
777
|
-
|
778
|
-
|
779
|
-
|
780
|
-
|
781
|
-
|
782
|
-
|
783
|
-
|
784
|
-
|
785
|
-
|
786
|
-
|
787
|
-
</
|
788
|
-
|
789
|
-
|
790
|
-
|
791
|
-
|
792
|
-
|
1143
|
+
<sections>
|
1144
|
+
<terms id='_' obligation='normative'>
|
1145
|
+
<title>Terms and definitions</title>
|
1146
|
+
<p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
|
1147
|
+
<term id='term-name-identity'>
|
1148
|
+
<preferred>name identity</preferred>
|
1149
|
+
</term>
|
1150
|
+
<term id='name-check'>
|
1151
|
+
<preferred>name check</preferred>
|
1152
|
+
<definition>
|
1153
|
+
<p id='_'>paragraph</p>
|
1154
|
+
<p id='_'>
|
1155
|
+
<concept>
|
1156
|
+
<refterm>name check</refterm>
|
1157
|
+
<renderterm>name check</renderterm>
|
1158
|
+
<xref target='name-check'/>
|
1159
|
+
</concept>
|
1160
|
+
is a term
|
1161
|
+
</p>
|
1162
|
+
<p id='_'>
|
1163
|
+
<concept>
|
1164
|
+
<refterm>name identity</refterm>
|
1165
|
+
<renderterm>name identity</renderterm>
|
1166
|
+
<xref target='term-name-identity'/>
|
1167
|
+
</concept>
|
1168
|
+
is a term
|
1169
|
+
</p>
|
1170
|
+
<p id='_'>
|
1171
|
+
Moreover,
|
1172
|
+
<concept>
|
1173
|
+
<strong>
|
1174
|
+
term
|
1175
|
+
<tt>missing</tt>
|
1176
|
+
not resolved via ID
|
1177
|
+
<tt>missing</tt>
|
1178
|
+
</strong>
|
1179
|
+
</concept>
|
1180
|
+
is a term
|
1181
|
+
</p>
|
1182
|
+
<p id='_'>
|
1183
|
+
<concept>
|
1184
|
+
<refterm>name check</refterm>
|
1185
|
+
<renderterm>name check</renderterm>
|
1186
|
+
<xref target='name-check'/>
|
1187
|
+
</concept>
|
1188
|
+
is a term
|
1189
|
+
</p>
|
1190
|
+
<p id='_'>
|
1191
|
+
<concept>
|
1192
|
+
<refterm>name identity</refterm>
|
1193
|
+
<renderterm>name identity</renderterm>
|
1194
|
+
<xref target='term-name-identity'/>
|
1195
|
+
</concept>
|
1196
|
+
is a term
|
1197
|
+
</p>
|
1198
|
+
<p id='_'>
|
1199
|
+
Moreover,
|
1200
|
+
<concept>
|
1201
|
+
<strong>
|
1202
|
+
term
|
1203
|
+
<tt>missing</tt>
|
1204
|
+
not resolved via ID
|
1205
|
+
<tt>missing</tt>
|
1206
|
+
</strong>
|
1207
|
+
</concept>
|
1208
|
+
is a term
|
1209
|
+
</p>
|
1210
|
+
</definition>
|
1211
|
+
</term>
|
1212
|
+
</terms>
|
1213
|
+
</sections>
|
1214
|
+
</standard-document>
|
793
1215
|
XML
|
794
1216
|
end
|
795
1217
|
|
796
|
-
it
|
1218
|
+
it "generates unique ids which do not match existing ids" do
|
797
1219
|
expect(convert).to(be_equivalent_to(xmlpp(output)))
|
798
1220
|
end
|
799
1221
|
end
|
800
|
-
|
801
|
-
end
|
802
|
-
|
1222
|
+
end
|
803
1223
|
end
|