metanorma-standoc 1.8.8 → 1.9.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -9,14 +9,15 @@ RSpec.describe Asciidoctor::Standoc do
9
9
  domain:[term1]
10
10
  inherit:[<<ref1>>]
11
11
  autonumber:table[3]
12
+ add:[a <<clause>>] del:[B]
12
13
 
13
14
  [bibliography]
14
15
  == Bibliography
15
16
  * [[[ref1,XYZ 123]]] _Title_
16
17
  INPUT
17
- #{BLANK_HDR}
18
+ #{BLANK_HDR}
18
19
  <preface>
19
- <foreword id='_' obligation='informative'>
20
+ <foreword id='_' obligation='informative'>
20
21
  <title>Foreword</title>
21
22
  <admitted>term1</admitted>
22
23
  <deprecates>term1</deprecates>
@@ -25,6 +26,11 @@ RSpec.describe Asciidoctor::Standoc do
25
26
  <eref type='inline' bibitemid='ref1' citeas='XYZ 123'/>
26
27
  </inherit>
27
28
  <autonumber type='table'>3</autonumber>
29
+ <add>
30
+ a
31
+ <xref target='clause'/>
32
+ </add>
33
+ <del>B</del>
28
34
  </foreword>
29
35
  </preface>
30
36
  <sections> </sections>
@@ -18,7 +18,7 @@ RSpec.describe Asciidoctor::Standoc do
18
18
  === Introduction Subsection
19
19
 
20
20
  == Acknowledgements
21
-
21
+
22
22
  [.preface]
23
23
  == Dedication
24
24
 
@@ -95,115 +95,111 @@ RSpec.describe Asciidoctor::Standoc do
95
95
  [index,type=thematic]
96
96
  == Thematic Index
97
97
  INPUT
98
- #{BLANK_HDR.sub(/<status>/, "<abstract> <p>Text</p> </abstract><status>")}
99
- <preface><abstract id="_">
100
- <title>Abstract</title>
101
- <p id="_">Text</p>
102
- </abstract><foreword id='_' obligation="informative">
103
- <title>Foreword</title>
104
- <p id="_">Text</p>
105
- </foreword><introduction id="_" obligation="informative">
106
- <title>Introduction</title>
107
- <clause id="_" inline-header="false" obligation="informative">
108
- <title>Introduction Subsection</title>
109
- </clause>
110
- </introduction>
111
- <clause id='_' inline-header='false' obligation='informative'>
112
- <title>Dedication</title>
113
- </clause>
114
- <acknowledgements id='_' obligation='informative'>
115
- <title>Acknowledgements</title>
116
- </acknowledgements>
117
- </preface><sections>
118
-
119
-
120
- <clause id="_" inline-header="false" obligation="normative" type="scope">
121
- <title>Scope</title>
122
- <p id="_">Text</p>
123
- </clause>
124
-
125
- <terms id="_" obligation="normative">
126
- <title>Terms and definitions</title>
127
- <p id="_">For the purposes of this document,
128
- the following terms and definitions apply.</p>
129
- <term id="term-term1">
130
- <preferred>Term1</preferred>
131
- </term>
132
- </terms>
133
- <clause id="_" obligation="normative"><title>Terms, definitions, symbols and abbreviated terms</title>
134
- <p id='_'>Boilerplate text</p>
135
- <clause id="_" inline-header="false" obligation="normative">
136
- <title>Introduction</title>
137
- <clause id="_" inline-header="false" obligation="normative">
138
- <title>Intro 1</title>
139
- </clause>
140
- </clause>
141
- <terms id="_" obligation="normative">
142
- <title>Intro 2</title>
143
- <clause id="_" inline-header="false" obligation="normative">
144
- <title>Intro 3</title>
145
- </clause>
146
- </terms>
147
- <clause id="_" obligation="normative">
148
- <title>Intro 4</title>
149
- <terms id="_" obligation="normative">
150
- <title>Intro 5</title>
151
- <term id="term-term1-1">
152
- <preferred>Term1</preferred>
153
- </term>
154
- </terms>
155
- </clause>
156
- <terms id="_" obligation="normative">
157
- <title>Normal Terms</title>
158
- <term id="term-term2">
159
- <preferred>Term2</preferred>
160
- </term>
161
- </terms>
162
- <definitions id="_" obligation="normative"><title>Symbols and abbreviated terms</title><clause id="_" inline-header="false" obligation="normative">
163
- <title>General</title>
164
- </clause>
165
- <definitions id="_" obligation="normative" type="symbols">
166
- <title>Symbols</title>
167
- </definitions></definitions></clause>
168
- <definitions id="_" obligation="normative" type="abbreviated_terms">
169
- <title>Abbreviated terms</title>
170
- </definitions>
171
- <clause id="_" inline-header="false" obligation="normative"><title>Clause 4</title><clause id="_" inline-header="false" obligation="normative">
172
- <title>Introduction</title>
173
- </clause>
174
- <clause id="_" inline-header="false" obligation="normative">
175
- <title>Clause 4.2</title>
176
- </clause></clause>
177
- <clause id="_" inline-header="false" obligation="normative">
178
- <title>Terms and Definitions</title>
179
- </clause>
180
-
181
- </sections><annex id="_" inline-header="false" obligation="normative">
182
- <title>Annex</title>
183
- <clause id="_" inline-header="false" obligation="normative">
184
- <title>Annex A.1</title>
185
- </clause>
186
- </annex><bibliography><references id="_" obligation="informative" normative="true">
187
- <title>Normative references</title>
188
- <p id="_">There are no normative references in this document.</p>
189
- </references><clause id="_" obligation="informative">
190
- <title>Bibliography</title>
191
- <references id="_" obligation="informative" normative="false">
192
- <title>Bibliography Subsection</title>
193
- </references>
194
- </clause></bibliography>
195
- <indexsect id='_'>
196
- <title>Index</title>
197
- <p id='_'>This is an index</p>
198
- </indexsect>
199
- <indexsect id='_' type='thematic'>
200
- <title>Thematic Index</title>
201
- </indexsect>
202
- </standard-document>
98
+ #{BLANK_HDR.sub(/<status>/, '<abstract> <p>Text</p> </abstract><status>')}
99
+ <preface><abstract id="_">
100
+ <title>Abstract</title>
101
+ <p id="_">Text</p>
102
+ </abstract><foreword id='_' obligation="informative">
103
+ <title>Foreword</title>
104
+ <p id="_">Text</p>
105
+ </foreword><introduction id="_" obligation="informative">
106
+ <title>Introduction</title>
107
+ <clause id="_" inline-header="false" obligation="informative">
108
+ <title>Introduction Subsection</title>
109
+ </clause>
110
+ </introduction>
111
+ <clause id='_' inline-header='false' obligation='informative'>
112
+ <title>Dedication</title>
113
+ </clause>
114
+ <acknowledgements id='_' obligation='informative'>
115
+ <title>Acknowledgements</title>
116
+ </acknowledgements>
117
+ </preface><sections>
118
+ <clause id="_" inline-header="false" obligation="normative" type="scope">
119
+ <title>Scope</title>
120
+ <p id="_">Text</p>
121
+ </clause>
122
+ <terms id="_" obligation="normative">
123
+ <title>Terms and definitions</title>
124
+ <p id="_">For the purposes of this document,
125
+ the following terms and definitions apply.</p>
126
+ <term id="term-term1">
127
+ <preferred>Term1</preferred>
128
+ </term>
129
+ </terms>
130
+ <clause id="_" obligation="normative"><title>Terms, definitions, symbols and abbreviated terms</title>
131
+ <p id='_'>Boilerplate text</p>
132
+ <clause id="_" inline-header="false" obligation="normative">
133
+ <title>Introduction</title>
134
+ <clause id="_" inline-header="false" obligation="normative">
135
+ <title>Intro 1</title>
136
+ </clause>
137
+ </clause>
138
+ <terms id="_" obligation="normative">
139
+ <title>Intro 2</title>
140
+ <clause id="_" inline-header="false" obligation="normative">
141
+ <title>Intro 3</title>
142
+ </clause>
143
+ </terms>
144
+ <clause id="_" obligation="normative">
145
+ <title>Intro 4</title>
146
+ <terms id="_" obligation="normative">
147
+ <title>Intro 5</title>
148
+ <term id="term-term1-1">
149
+ <preferred>Term1</preferred>
150
+ </term>
151
+ </terms>
152
+ </clause>
153
+ <terms id="_" obligation="normative">
154
+ <title>Normal Terms</title>
155
+ <term id="term-term2">
156
+ <preferred>Term2</preferred>
157
+ </term>
158
+ </terms>
159
+ <definitions id="_" obligation="normative"><title>Symbols and abbreviated terms</title><clause id="_" inline-header="false" obligation="normative">
160
+ <title>General</title>
161
+ </clause>
162
+ <definitions id="_" obligation="normative" type="symbols">
163
+ <title>Symbols</title>
164
+ </definitions></definitions></clause>
165
+ <definitions id="_" obligation="normative" type="abbreviated_terms">
166
+ <title>Abbreviated terms</title>
167
+ </definitions>
168
+ <clause id="_" inline-header="false" obligation="normative"><title>Clause 4</title><clause id="_" inline-header="false" obligation="normative">
169
+ <title>Introduction</title>
170
+ </clause>
171
+ <clause id="_" inline-header="false" obligation="normative">
172
+ <title>Clause 4.2</title>
173
+ </clause></clause>
174
+ <clause id="_" inline-header="false" obligation="normative">
175
+ <title>Terms and Definitions</title>
176
+ </clause>
177
+ </sections><annex id="_" inline-header="false" obligation="normative">
178
+ <title>Annex</title>
179
+ <clause id="_" inline-header="false" obligation="normative">
180
+ <title>Annex A.1</title>
181
+ </clause>
182
+ </annex><bibliography><references id="_" obligation="informative" normative="true">
183
+ <title>Normative references</title>
184
+ <p id="_">There are no normative references in this document.</p>
185
+ </references><clause id="_" obligation="informative">
186
+ <title>Bibliography</title>
187
+ <references id="_" obligation="informative" normative="false">
188
+ <title>Bibliography Subsection</title>
189
+ </references>
190
+ </clause></bibliography>
191
+ <indexsect id='_'>
192
+ <title>Index</title>
193
+ <p id='_'>This is an index</p>
194
+ </indexsect>
195
+ <indexsect id='_' type='thematic'>
196
+ <title>Thematic Index</title>
197
+ </indexsect>
198
+ </standard-document>
203
199
  OUTPUT
204
200
  end
205
201
 
206
- it "processes sections with number attributes" do
202
+ it "processes sections with number attributes" do
207
203
  expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
208
204
  #{ASCIIDOC_BLANK_HDR}
209
205
  [number=1bis]
@@ -268,81 +264,81 @@ RSpec.describe Asciidoctor::Standoc do
268
264
  [number=20bis]
269
265
  === Bibliography Subsection
270
266
  INPUT
271
- #{BLANK_HDR}
272
- <sections>
273
- <clause id='_' number='1bis' type='scope' inline-header='false' obligation='normative'>
274
- <title>Scope</title>
275
- <p id='_'>Text</p>
276
- </clause>
277
- <terms id='_' number='3bis' obligation='normative'>
278
- <title>Terms and definitions</title>
279
- <p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
280
- <term id='term-term1' number='4bis'>
281
- <preferred>Term1</preferred>
282
- </term>
283
- </terms>
284
- <terms id='_' number='5bis' obligation='normative'>
285
- <title>Terms, definitions, symbols and abbreviated terms</title>
286
- <p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
287
- <clause id='_' number='6bis' inline-header='false' obligation='normative'>
288
- <title>Introduction</title>
289
- <clause id='_' number='7bis' inline-header='false' obligation='normative'>
290
- <title>Intro 1</title>
291
- </clause>
267
+ #{BLANK_HDR}
268
+ <sections>
269
+ <clause id='_' number='1bis' type='scope' inline-header='false' obligation='normative'>
270
+ <title>Scope</title>
271
+ <p id='_'>Text</p>
292
272
  </clause>
293
- <term id='term-intro-2' number='8bis'>
294
- <preferred>Intro 2</preferred>
295
- </term>
296
- <definitions id='_' number='9bis' obligation='normative'>
297
- <title>Symbols and abbreviated terms</title>
298
- <clause id='_' number='10bis' inline-header='false' obligation='normative'>
299
- <title>General</title>
273
+ <terms id='_' number='3bis' obligation='normative'>
274
+ <title>Terms and definitions</title>
275
+ <p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
276
+ <term id='term-term1' number='4bis'>
277
+ <preferred>Term1</preferred>
278
+ </term>
279
+ </terms>
280
+ <terms id='_' number='5bis' obligation='normative'>
281
+ <title>Terms, definitions, symbols and abbreviated terms</title>
282
+ <p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
283
+ <clause id='_' number='6bis' inline-header='false' obligation='normative'>
284
+ <title>Introduction</title>
285
+ <clause id='_' number='7bis' inline-header='false' obligation='normative'>
286
+ <title>Intro 1</title>
287
+ </clause>
300
288
  </clause>
301
- <definitions id='_' number='11bis' type='symbols' obligation='normative'>
302
- <title>Symbols</title>
289
+ <term id='term-intro-2' number='8bis'>
290
+ <preferred>Intro 2</preferred>
291
+ </term>
292
+ <definitions id='_' number='9bis' obligation='normative'>
293
+ <title>Symbols and abbreviated terms</title>
294
+ <clause id='_' number='10bis' inline-header='false' obligation='normative'>
295
+ <title>General</title>
296
+ </clause>
297
+ <definitions id='_' number='11bis' type='symbols' obligation='normative'>
298
+ <title>Symbols</title>
299
+ </definitions>
303
300
  </definitions>
301
+ </terms>
302
+ <definitions id='_' number='12bis' type='abbreviated_terms' obligation='normative'>
303
+ <title>Abbreviated terms</title>
304
304
  </definitions>
305
- </terms>
306
- <definitions id='_' number='12bis' type='abbreviated_terms' obligation='normative'>
307
- <title>Abbreviated terms</title>
308
- </definitions>
309
- <clause id='_' number='13bis' inline-header='false' obligation='normative'>
310
- <title>Clause 4</title>
311
- <clause id='_' number='14bis' inline-header='false' obligation='normative'>
312
- <title>Introduction</title>
305
+ <clause id='_' number='13bis' inline-header='false' obligation='normative'>
306
+ <title>Clause 4</title>
307
+ <clause id='_' number='14bis' inline-header='false' obligation='normative'>
308
+ <title>Introduction</title>
309
+ </clause>
310
+ <clause id='_' number='15bis' inline-header='false' obligation='normative'>
311
+ <title>Clause 4.2</title>
312
+ </clause>
313
313
  </clause>
314
- <clause id='_' number='15bis' inline-header='false' obligation='normative'>
315
- <title>Clause 4.2</title>
314
+ <clause id='_' number='16bis' inline-header='false' obligation='normative'>
315
+ <title>Terms and Definitions</title>
316
316
  </clause>
317
- </clause>
318
- <clause id='_' number='16bis' inline-header='false' obligation='normative'>
319
- <title>Terms and Definitions</title>
320
- </clause>
321
- </sections>
322
- <annex id='_' number='17bis' inline-header='false' obligation='normative'>
323
- <title>Annex</title>
324
- <clause id='_' number='18bis' inline-header='false' obligation='normative'>
325
- <title>Annex A.1</title>
326
- </clause>
327
- </annex>
328
- <bibliography>
329
- <references id='_' number='2bis' normative='true' obligation='informative'>
330
- <title>Normative references</title>
331
- <p id='_'>There are no normative references in this document.</p>
332
- </references>
333
- <clause id='_' number='19bis' obligation='informative'>
334
- <title>Bibliography</title>
335
- <references id='_' number='20bis' normative='false' obligation='informative'>
336
- <title>Bibliography Subsection</title>
317
+ </sections>
318
+ <annex id='_' number='17bis' inline-header='false' obligation='normative'>
319
+ <title>Annex</title>
320
+ <clause id='_' number='18bis' inline-header='false' obligation='normative'>
321
+ <title>Annex A.1</title>
322
+ </clause>
323
+ </annex>
324
+ <bibliography>
325
+ <references id='_' number='2bis' normative='true' obligation='informative'>
326
+ <title>Normative references</title>
327
+ <p id='_'>There are no normative references in this document.</p>
337
328
  </references>
338
- </clause>
339
- </bibliography>
340
- </standard-document>
341
- OUTPUT
342
- end
329
+ <clause id='_' number='19bis' obligation='informative'>
330
+ <title>Bibliography</title>
331
+ <references id='_' number='20bis' normative='false' obligation='informative'>
332
+ <title>Bibliography Subsection</title>
333
+ </references>
334
+ </clause>
335
+ </bibliography>
336
+ </standard-document>
337
+ OUTPUT
338
+ end
343
339
 
344
- it "processes sections with language and script attributes" do
345
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
340
+ it "processes sections with language and script attributes" do
341
+ expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
346
342
  #{ASCIIDOC_BLANK_HDR}
347
343
  [language=en,script=Latn]
348
344
  == Foreword
@@ -446,106 +442,102 @@ RSpec.describe Asciidoctor::Standoc do
446
442
  [language=en,script=Latn]
447
443
  === Bibliography Subsection
448
444
  INPUT
449
- #{BLANK_HDR.sub(/<status>/, "<abstract> <p>Text</p> </abstract><status>")}
450
- <preface><abstract id="_" language="en" script="Latn">
451
- <title>Abstract</title>
452
- <p id="_">Text</p>
453
- </abstract><foreword id='_' language='en' script='Latn' obligation='informative'>
454
- <title>Foreword</title>
455
- <p id="_">Text</p>
456
- </foreword><introduction id="_" language="en" script="Latn" obligation="informative">
457
- <title>Introduction</title>
458
- <clause id="_" language="en" script="Latn" inline-header="false" obligation="informative">
459
- <title>Introduction Subsection</title>
460
- </clause>
461
- </introduction>
462
- <clause id='_' language='en' script='Latn' inline-header='false' obligation='informative'>
463
- <title>Dedication</title>
464
- </clause>
465
- <acknowledgements id='_' language='en' script='Latn' obligation='informative'>
466
- <title>Acknowledgements</title>
467
- </acknowledgements>
468
- </preface><sections>
469
-
470
-
471
- <clause id="_" language="en" script="Latn" inline-header="false" obligation="normative" type="scope">
472
- <title>Scope</title>
473
- <p id="_">Text</p>
474
- </clause>
475
-
476
- <terms id="_" language="en" script="Latn" obligation="normative">
477
- <title>Terms and definitions</title>
478
- <p id="_">For the purposes of this document,
479
- the following terms and definitions apply.</p>
480
- <term id="term-term1" language="en" script="Latn">
481
- <preferred>Term1</preferred>
482
- </term>
483
- </terms>
484
- <clause id="_" language="en" script="Latn" obligation="normative"><title>Terms, definitions, symbols and abbreviated terms</title>
485
- <p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
486
- <clause id="_" language="en" script="Latn" inline-header="false" obligation="normative">
487
- <title>Introduction</title>
488
- <clause id="_" inline-header="false" obligation="normative">
489
- <title>Intro 1</title>
490
- </clause>
491
- </clause>
492
- <terms id="_" language="en" script="Latn" obligation="normative">
493
- <title>Intro 2</title>
494
- <clause id="_" language="en" script="Latn" inline-header="false" obligation="normative">
495
- <title>Intro 3</title>
496
- </clause>
497
- </terms>
498
- <clause id="_" language="en" script="Latn" obligation="normative">
499
- <title>Intro 4</title>
500
- <terms id="_" language="en" script="Latn" obligation="normative">
501
- <title>Intro 5</title>
502
- <term id="term-term1-1">
503
- <preferred>Term1</preferred>
504
- </term>
505
- </terms>
506
- </clause>
507
- <terms id="_" language="en" script="Latn" obligation="normative">
508
- <title>Normal Terms</title>
509
- <term id="term-term2">
510
- <preferred>Term2</preferred>
511
- </term>
512
- </terms>
513
- <definitions id="_" language="en" script="Latn" obligation="normative"><title>Symbols and abbreviated terms</title><clause id="_" language="en" script="Latn" inline-header="false" obligation="normative">
514
- <title>General</title>
515
- </clause>
516
- <definitions id="_" obligation="normative" type="symbols">
517
- <title>Symbols</title>
518
- </definitions></definitions></clause>
519
- <definitions id="_" language="en" script="Latn" obligation="normative" type="abbreviated_terms">
520
- <title>Abbreviated terms</title>
521
- </definitions>
522
- <clause id="_" language="en" script="Latn" inline-header="false" obligation="normative"><title>Clause 4</title><clause id="_" language="en" script="Latn" inline-header="false" obligation="normative">
523
- <title>Introduction</title>
524
- </clause>
525
- <clause id="_" language="en" script="Latn" inline-header="false" obligation="normative">
526
- <title>Clause 4.2</title>
527
- </clause></clause>
528
- <clause id="_" language="en" script="Latn" inline-header="false" obligation="normative">
529
- <title>Terms and Definitions</title>
530
- </clause>
531
-
532
- </sections><annex id="_" language="en" script="Latn" inline-header="false" obligation="normative">
533
- <title>Annex</title>
534
- <clause id="_" language="en" script="Latn" inline-header="false" obligation="normative">
535
- <title>Annex A.1</title>
536
- </clause>
537
- </annex><bibliography><references id="_" language="en" script="Latn" obligation="informative" normative="true">
538
- <title>Normative references</title>
539
- <p id="_">There are no normative references in this document.</p>
540
- </references><clause id="_" language="en" script="Latn" obligation="informative">
541
- <title>Bibliography</title>
542
- <references id="_" language="en" script="Latn" obligation="informative" normative="false">
543
- <title>Bibliography Subsection</title>
544
- </references>
545
- </clause></bibliography>
546
- </standard-document>
445
+ #{BLANK_HDR.sub(/<status>/, '<abstract> <p>Text</p> </abstract><status>')}
446
+ <preface><abstract id="_" language="en" script="Latn">
447
+ <title>Abstract</title>
448
+ <p id="_">Text</p>
449
+ </abstract><foreword id='_' language='en' script='Latn' obligation='informative'>
450
+ <title>Foreword</title>
451
+ <p id="_">Text</p>
452
+ </foreword><introduction id="_" language="en" script="Latn" obligation="informative">
453
+ <title>Introduction</title>
454
+ <clause id="_" language="en" script="Latn" inline-header="false" obligation="informative">
455
+ <title>Introduction Subsection</title>
456
+ </clause>
457
+ </introduction>
458
+ <clause id='_' language='en' script='Latn' inline-header='false' obligation='informative'>
459
+ <title>Dedication</title>
460
+ </clause>
461
+ <acknowledgements id='_' language='en' script='Latn' obligation='informative'>
462
+ <title>Acknowledgements</title>
463
+ </acknowledgements>
464
+ </preface><sections>
465
+ <clause id="_" language="en" script="Latn" inline-header="false" obligation="normative" type="scope">
466
+ <title>Scope</title>
467
+ <p id="_">Text</p>
468
+ </clause>
469
+ <terms id="_" language="en" script="Latn" obligation="normative">
470
+ <title>Terms and definitions</title>
471
+ <p id="_">For the purposes of this document,
472
+ the following terms and definitions apply.</p>
473
+ <term id="term-term1" language="en" script="Latn">
474
+ <preferred>Term1</preferred>
475
+ </term>
476
+ </terms>
477
+ <clause id="_" language="en" script="Latn" obligation="normative"><title>Terms, definitions, symbols and abbreviated terms</title>
478
+ <p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
479
+ <clause id="_" language="en" script="Latn" inline-header="false" obligation="normative">
480
+ <title>Introduction</title>
481
+ <clause id="_" inline-header="false" obligation="normative">
482
+ <title>Intro 1</title>
483
+ </clause>
484
+ </clause>
485
+ <terms id="_" language="en" script="Latn" obligation="normative">
486
+ <title>Intro 2</title>
487
+ <clause id="_" language="en" script="Latn" inline-header="false" obligation="normative">
488
+ <title>Intro 3</title>
489
+ </clause>
490
+ </terms>
491
+ <clause id="_" language="en" script="Latn" obligation="normative">
492
+ <title>Intro 4</title>
493
+ <terms id="_" language="en" script="Latn" obligation="normative">
494
+ <title>Intro 5</title>
495
+ <term id="term-term1-1">
496
+ <preferred>Term1</preferred>
497
+ </term>
498
+ </terms>
499
+ </clause>
500
+ <terms id="_" language="en" script="Latn" obligation="normative">
501
+ <title>Normal Terms</title>
502
+ <term id="term-term2">
503
+ <preferred>Term2</preferred>
504
+ </term>
505
+ </terms>
506
+ <definitions id="_" language="en" script="Latn" obligation="normative"><title>Symbols and abbreviated terms</title><clause id="_" language="en" script="Latn" inline-header="false" obligation="normative">
507
+ <title>General</title>
508
+ </clause>
509
+ <definitions id="_" obligation="normative" type="symbols">
510
+ <title>Symbols</title>
511
+ </definitions></definitions></clause>
512
+ <definitions id="_" language="en" script="Latn" obligation="normative" type="abbreviated_terms">
513
+ <title>Abbreviated terms</title>
514
+ </definitions>
515
+ <clause id="_" language="en" script="Latn" inline-header="false" obligation="normative"><title>Clause 4</title><clause id="_" language="en" script="Latn" inline-header="false" obligation="normative">
516
+ <title>Introduction</title>
517
+ </clause>
518
+ <clause id="_" language="en" script="Latn" inline-header="false" obligation="normative">
519
+ <title>Clause 4.2</title>
520
+ </clause></clause>
521
+ <clause id="_" language="en" script="Latn" inline-header="false" obligation="normative">
522
+ <title>Terms and Definitions</title>
523
+ </clause>
524
+ </sections><annex id="_" language="en" script="Latn" inline-header="false" obligation="normative">
525
+ <title>Annex</title>
526
+ <clause id="_" language="en" script="Latn" inline-header="false" obligation="normative">
527
+ <title>Annex A.1</title>
528
+ </clause>
529
+ </annex><bibliography><references id="_" language="en" script="Latn" obligation="informative" normative="true">
530
+ <title>Normative references</title>
531
+ <p id="_">There are no normative references in this document.</p>
532
+ </references><clause id="_" language="en" script="Latn" obligation="informative">
533
+ <title>Bibliography</title>
534
+ <references id="_" language="en" script="Latn" obligation="informative" normative="false">
535
+ <title>Bibliography Subsection</title>
536
+ </references>
537
+ </clause></bibliography>
538
+ </standard-document>
547
539
  OUTPUT
548
- end
540
+ end
549
541
 
550
542
  it "processes sections with title and type attributes" do
551
543
  expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
@@ -606,84 +598,84 @@ RSpec.describe Asciidoctor::Standoc do
606
598
 
607
599
  === Bibliography Subsection
608
600
  INPUT
609
- #{BLANK_HDR.sub(/<status>/, "<abstract> <p>Text</p> </abstract><status>")}
610
- <preface>
611
- <abstract id='_'>
612
- <title>Abstract</title>
613
- <p id='_'>Text</p>
614
- </abstract>
615
- <foreword id='_' obligation='informative'>
616
- <title>Foreword</title>
617
- <p id='_'>Text</p>
618
- </foreword>
619
- <introduction id='_' obligation='informative'>
620
- <title>Introduction</title>
621
- <clause id='_' inline-header='false' obligation='informative'>
622
- <title>Introduction Subsection</title>
623
- </clause>
624
- </introduction>
625
- <acknowledgements id='_' obligation='informative'>
626
- <title>Acknowledgements</title>
627
- </acknowledgements>
628
- </preface>
629
- <sections>
630
- <terms id='_' obligation='normative'>
631
- <title>Terms and definitions</title>
632
- <p id="_">For the purposes of this document, the following terms and definitions apply.</p>
633
- <term id='term-term1'>
634
- <preferred>Term1</preferred>
635
- </term>
636
- </terms>
637
- <clause id='_' obligation='normative'>
638
- <title>Terms, definitions and symbols</title>
639
- <p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
640
- <terms id='_' obligation='normative'>
641
- <title>Normal Terms</title>
642
- <term id='term-term2'>
643
- <preferred>Term2</preferred>
644
- </term>
645
- </terms>
646
- <definitions id='_' obligation="normative" type="symbols">
647
- <title>Symbols</title>
648
- </definitions>
649
- </clause>
650
- <definitions id='_' obligation="normative" type="abbreviated_terms">
651
- <title>Abbreviated terms</title>
652
- </definitions>
653
- <clause id='_' inline-header='false' obligation='normative' type="ABC">
654
- <title>Clause 4</title>
655
- <clause id='_' inline-header='false' obligation='normative' type="DEF">
656
- <title>Introduction</title>
657
- </clause>
658
- <clause id='_' inline-header='false' obligation='normative'>
659
- <title>Clause 4.2</title>
660
- </clause>
661
- </clause>
662
- </sections>
663
- <annex id='_' inline-header='false' obligation='normative'>
664
- <title>Annex</title>
665
- <clause id='_' inline-header='false' obligation='normative'>
666
- <title>Annex A.1</title>
667
- </clause>
668
- </annex>
669
- <bibliography>
670
- <references id='_' obligation='informative' normative="true">
671
- <title>Normative references</title>
672
- <p id="_">There are no normative references in this document.</p>
673
- </references>
674
- <clause id='_' obligation='informative'>
675
- <title>Bibliography</title>
676
- <references id='_' obligation='informative' normative="false">
677
- <title>Bibliography Subsection</title>
678
- </references>
679
- </clause>
680
- </bibliography>
681
- </standard-document>
601
+ #{BLANK_HDR.sub(/<status>/, '<abstract> <p>Text</p> </abstract><status>')}
602
+ <preface>
603
+ <abstract id='_'>
604
+ <title>Abstract</title>
605
+ <p id='_'>Text</p>
606
+ </abstract>
607
+ <foreword id='_' obligation='informative'>
608
+ <title>Foreword</title>
609
+ <p id='_'>Text</p>
610
+ </foreword>
611
+ <introduction id='_' obligation='informative'>
612
+ <title>Introduction</title>
613
+ <clause id='_' inline-header='false' obligation='informative'>
614
+ <title>Introduction Subsection</title>
615
+ </clause>
616
+ </introduction>
617
+ <acknowledgements id='_' obligation='informative'>
618
+ <title>Acknowledgements</title>
619
+ </acknowledgements>
620
+ </preface>
621
+ <sections>
622
+ <terms id='_' obligation='normative'>
623
+ <title>Terms and definitions</title>
624
+ <p id="_">For the purposes of this document, the following terms and definitions apply.</p>
625
+ <term id='term-term1'>
626
+ <preferred>Term1</preferred>
627
+ </term>
628
+ </terms>
629
+ <clause id='_' obligation='normative'>
630
+ <title>Terms, definitions and symbols</title>
631
+ <p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
632
+ <terms id='_' obligation='normative'>
633
+ <title>Normal Terms</title>
634
+ <term id='term-term2'>
635
+ <preferred>Term2</preferred>
636
+ </term>
637
+ </terms>
638
+ <definitions id='_' obligation="normative" type="symbols">
639
+ <title>Symbols</title>
640
+ </definitions>
641
+ </clause>
642
+ <definitions id='_' obligation="normative" type="abbreviated_terms">
643
+ <title>Abbreviated terms</title>
644
+ </definitions>
645
+ <clause id='_' inline-header='false' obligation='normative' type="ABC">
646
+ <title>Clause 4</title>
647
+ <clause id='_' inline-header='false' obligation='normative' type="DEF">
648
+ <title>Introduction</title>
649
+ </clause>
650
+ <clause id='_' inline-header='false' obligation='normative'>
651
+ <title>Clause 4.2</title>
652
+ </clause>
653
+ </clause>
654
+ </sections>
655
+ <annex id='_' inline-header='false' obligation='normative'>
656
+ <title>Annex</title>
657
+ <clause id='_' inline-header='false' obligation='normative'>
658
+ <title>Annex A.1</title>
659
+ </clause>
660
+ </annex>
661
+ <bibliography>
662
+ <references id='_' obligation='informative' normative="true">
663
+ <title>Normative references</title>
664
+ <p id="_">There are no normative references in this document.</p>
665
+ </references>
666
+ <clause id='_' obligation='informative'>
667
+ <title>Bibliography</title>
668
+ <references id='_' obligation='informative' normative="false">
669
+ <title>Bibliography Subsection</title>
670
+ </references>
671
+ </clause>
672
+ </bibliography>
673
+ </standard-document>
682
674
  OUTPUT
683
675
  end
684
676
 
685
677
  it "varies terms & symbols title" do
686
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
678
+ expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
687
679
  #{ASCIIDOC_BLANK_HDR}
688
680
  [heading="terms, definitions, symbols and abbreviated terms"]
689
681
  == Terms, Definitions, Symbols Section
@@ -692,56 +684,55 @@ RSpec.describe Asciidoctor::Standoc do
692
684
 
693
685
  === Symbols
694
686
 
695
- INPUT
696
- #{BLANK_HDR}
697
- <sections>
698
- <terms id='_' obligation='normative'>
699
- <title>Terms, definitions and symbols</title>
700
- <p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
701
- <term id='term-term'>
702
- <preferred>Term</preferred>
703
- </term>
704
- <definitions id='_' obligation="normative" type="symbols">
705
- <title>Symbols</title>
706
- </definitions>
707
- </terms>
708
- </sections>
709
- </standard-document>
710
- OUTPUT
711
- end
687
+ INPUT
688
+ #{BLANK_HDR}
689
+ <sections>
690
+ <terms id='_' obligation='normative'>
691
+ <title>Terms, definitions and symbols</title>
692
+ <p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
693
+ <term id='term-term'>
694
+ <preferred>Term</preferred>
695
+ </term>
696
+ <definitions id='_' obligation="normative" type="symbols">
697
+ <title>Symbols</title>
698
+ </definitions>
699
+ </terms>
700
+ </sections>
701
+ </standard-document>
702
+ OUTPUT
703
+ end
712
704
 
713
705
  it "varies terms & abbreviated terms title" do
714
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
715
- #{ASCIIDOC_BLANK_HDR}
716
- [heading="terms, definitions, symbols and abbreviated terms"]
717
- == Terms, Definitions, Abbreviated Terms Section
706
+ expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
707
+ #{ASCIIDOC_BLANK_HDR}
708
+ [heading="terms, definitions, symbols and abbreviated terms"]
709
+ == Terms, Definitions, Abbreviated Terms Section
718
710
 
719
- === Term
720
-
721
- [heading="abbreviated terms"]
722
- === Symbols
711
+ === Term
723
712
 
724
- INPUT
725
- #{BLANK_HDR}
726
- <sections>
727
- <terms id='_' obligation='normative'>
728
- <title>Terms, definitions and abbreviated terms</title>
729
- <p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
730
- <term id='term-term'>
731
- <preferred>Term</preferred>
732
- </term>
733
- <definitions id='_' obligation="normative" type="abbreviated_terms">
734
- <title>Abbreviated terms</title>
735
- </definitions>
736
- </terms>
737
- </sections>
738
- </standard-document>
739
- OUTPUT
740
- end
713
+ [heading="abbreviated terms"]
714
+ === Symbols
741
715
 
716
+ INPUT
717
+ #{BLANK_HDR}
718
+ <sections>
719
+ <terms id='_' obligation='normative'>
720
+ <title>Terms, definitions and abbreviated terms</title>
721
+ <p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
722
+ <term id='term-term'>
723
+ <preferred>Term</preferred>
724
+ </term>
725
+ <definitions id='_' obligation="normative" type="abbreviated_terms">
726
+ <title>Abbreviated terms</title>
727
+ </definitions>
728
+ </terms>
729
+ </sections>
730
+ </standard-document>
731
+ OUTPUT
732
+ end
742
733
 
743
734
  it "processes section obligations" do
744
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
735
+ expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
745
736
  #{ASCIIDOC_BLANK_HDR}
746
737
  [obligation=informative]
747
738
  == Clause 1
@@ -753,26 +744,26 @@ RSpec.describe Asciidoctor::Standoc do
753
744
 
754
745
  [appendix,obligation=informative]
755
746
  == Annex
756
- INPUT
757
- #{BLANK_HDR}
758
- <sections><clause id="_" inline-header="false" obligation="informative">
759
- <title>Clause 1</title>
760
- <clause id="_" inline-header="false" obligation="informative">
761
- <title>Clause 1a</title>
762
- </clause>
763
- </clause>
764
- <clause id="_" inline-header="false" obligation="normative">
765
- <title>Clause 2</title>
766
- </clause>
767
- </sections><annex id="_" inline-header="false" obligation="informative">
768
- <title>Annex</title>
769
- </annex>
770
- </standard-document>
771
- OUTPUT
747
+ INPUT
748
+ #{BLANK_HDR}
749
+ <sections><clause id="_" inline-header="false" obligation="informative">
750
+ <title>Clause 1</title>
751
+ <clause id="_" inline-header="false" obligation="informative">
752
+ <title>Clause 1a</title>
753
+ </clause>
754
+ </clause>
755
+ <clause id="_" inline-header="false" obligation="normative">
756
+ <title>Clause 2</title>
757
+ </clause>
758
+ </sections><annex id="_" inline-header="false" obligation="informative">
759
+ <title>Annex</title>
760
+ </annex>
761
+ </standard-document>
762
+ OUTPUT
772
763
  end
773
764
 
774
- it "processes inline headers" do
775
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
765
+ it "processes inline headers" do
766
+ expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
776
767
  #{ASCIIDOC_BLANK_HDR}
777
768
  == Clause 1
778
769
 
@@ -784,46 +775,46 @@ RSpec.describe Asciidoctor::Standoc do
784
775
 
785
776
  [%inline-header]
786
777
  === Clause Aa
787
- INPUT
788
- #{BLANK_HDR}
789
- <sections><clause id="_" inline-header="false" obligation="normative">
790
- <title>Clause 1</title>
791
- <clause id="_" inline-header="true" obligation="normative">
792
- <title>Clause 1a</title>
793
- </clause>
794
- </clause>
795
- </sections><annex id="_" inline-header="false" obligation="normative">
796
- <title>Annex A</title>
797
- <clause id="_" inline-header="true" obligation="normative">
798
- <title>Clause Aa</title>
799
- </clause>
800
- </annex>
801
- </standard-document>
802
- OUTPUT
803
- end
778
+ INPUT
779
+ #{BLANK_HDR}
780
+ <sections><clause id="_" inline-header="false" obligation="normative">
781
+ <title>Clause 1</title>
782
+ <clause id="_" inline-header="true" obligation="normative">
783
+ <title>Clause 1a</title>
784
+ </clause>
785
+ </clause>
786
+ </sections><annex id="_" inline-header="false" obligation="normative">
787
+ <title>Annex A</title>
788
+ <clause id="_" inline-header="true" obligation="normative">
789
+ <title>Clause Aa</title>
790
+ </clause>
791
+ </annex>
792
+ </standard-document>
793
+ OUTPUT
794
+ end
804
795
 
805
796
  it "processes blank headers" do
806
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
797
+ expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
807
798
  #{ASCIIDOC_BLANK_HDR}
808
799
  == Clause 1
809
800
 
810
801
  === {blank}
811
802
 
812
- INPUT
813
- #{BLANK_HDR}
814
- <sections>
815
- <clause id="_" inline-header="false" obligation="normative">
816
- <title>Clause 1</title>
817
- <clause id="_" inline-header="false" obligation="normative">
818
- </clause>
819
- </clause>
820
- </sections>
821
- </standard-document>
822
- OUTPUT
803
+ INPUT
804
+ #{BLANK_HDR}
805
+ <sections>
806
+ <clause id="_" inline-header="false" obligation="normative">
807
+ <title>Clause 1</title>
808
+ <clause id="_" inline-header="false" obligation="normative">
809
+ </clause>
810
+ </clause>
811
+ </sections>
812
+ </standard-document>
813
+ OUTPUT
823
814
  end
824
815
 
825
- it "processes terminal nodes in terms with term subsection names" do
826
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
816
+ it "processes terminal nodes in terms with term subsection names" do
817
+ expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
827
818
  #{ASCIIDOC_BLANK_HDR}
828
819
 
829
820
  == Terms, definitions, symbols and abbreviated terms
@@ -832,27 +823,26 @@ RSpec.describe Asciidoctor::Standoc do
832
823
 
833
824
  === Symbols
834
825
 
835
- INPUT
836
- #{BLANK_HDR}
837
- <sections>
838
- <terms id='_' obligation='normative'>
839
- <title>Terms, definitions and symbols</title>
840
- <p id='_'>No terms and definitions are listed in this document.</p>
841
- <clause id='_' inline-header='false' obligation='normative'>
842
- <title>Terms and definitions</title>
843
- </clause>
844
- <definitions id='_' obligation="normative" type="symbols">
845
- <title>Symbols</title>
846
- </definitions>
847
- </terms>
848
- </sections>
849
- </standard-document>
850
- OUTPUT
851
- end
852
-
853
-
854
- it "processes terms & definitions with external source" do
855
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
826
+ INPUT
827
+ #{BLANK_HDR}
828
+ <sections>
829
+ <terms id='_' obligation='normative'>
830
+ <title>Terms, definitions and symbols</title>
831
+ <p id='_'>No terms and definitions are listed in this document.</p>
832
+ <clause id='_' inline-header='false' obligation='normative'>
833
+ <title>Terms and definitions</title>
834
+ </clause>
835
+ <definitions id='_' obligation="normative" type="symbols">
836
+ <title>Symbols</title>
837
+ </definitions>
838
+ </terms>
839
+ </sections>
840
+ </standard-document>
841
+ OUTPUT
842
+ end
843
+
844
+ it "processes terms & definitions with external source" do
845
+ expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
856
846
  #{ASCIIDOC_BLANK_HDR}
857
847
 
858
848
  Foreword
@@ -862,27 +852,26 @@ RSpec.describe Asciidoctor::Standoc do
862
852
 
863
853
  === Term1
864
854
 
865
- INPUT
866
- #{BLANK_HDR}
867
- <termdocsource bibitemid="iso1234"/><termdocsource bibitemid="iso5678"/>
868
- <preface><foreword id='_' obligation="informative">
869
- <title>Foreword</title>
870
- <p id="_">Foreword</p>
871
- </foreword></preface><sections>
872
- <terms id="_" obligation="normative">
873
- <title>Terms and definitions</title><p id="_">For the purposes of this document, the terms and definitions
874
- given in <eref bibitemid="iso1234"/> and <eref bibitemid="iso5678"/> and the following apply.</p>
875
- <term id="term-term1">
876
- <preferred>Term1</preferred>
877
- </term>
878
- </terms></sections>
879
- </standard-document>
880
-
881
- OUTPUT
882
- end
883
-
884
- it "processes empty terms & definitions" do
885
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
855
+ INPUT
856
+ #{BLANK_HDR}
857
+ <termdocsource bibitemid="iso1234"/><termdocsource bibitemid="iso5678"/>
858
+ <preface><foreword id='_' obligation="informative">
859
+ <title>Foreword</title>
860
+ <p id="_">Foreword</p>
861
+ </foreword></preface><sections>
862
+ <terms id="_" obligation="normative">
863
+ <title>Terms and definitions</title><p id="_">For the purposes of this document, the terms and definitions
864
+ given in <eref bibitemid="iso1234"/> and <eref bibitemid="iso5678"/> and the following apply.</p>
865
+ <term id="term-term1">
866
+ <preferred>Term1</preferred>
867
+ </term>
868
+ </terms></sections>
869
+ </standard-document>
870
+ OUTPUT
871
+ end
872
+
873
+ it "processes empty terms & definitions" do
874
+ expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
886
875
  #{ASCIIDOC_BLANK_HDR}
887
876
 
888
877
  Foreword
@@ -890,23 +879,22 @@ RSpec.describe Asciidoctor::Standoc do
890
879
  == Terms and Definitions
891
880
 
892
881
 
893
- INPUT
894
- #{BLANK_HDR}
895
- <preface><foreword id='_' obligation="informative">
896
- <title>Foreword</title>
897
- <p id="_">Foreword</p>
898
- </foreword></preface><sections>
899
- <terms id="_" obligation="normative">
900
- <title>Terms and definitions</title><p id="_">No terms and definitions are listed in this document.</p>
901
- </terms></sections>
902
- </standard-document>
903
-
904
- OUTPUT
905
- end
882
+ INPUT
883
+ #{BLANK_HDR}
884
+ <preface><foreword id='_' obligation="informative">
885
+ <title>Foreword</title>
886
+ <p id="_">Foreword</p>
887
+ </foreword></preface><sections>
888
+ <terms id="_" obligation="normative">
889
+ <title>Terms and definitions</title><p id="_">No terms and definitions are listed in this document.</p>
890
+ </terms></sections>
891
+ </standard-document>
906
892
 
893
+ OUTPUT
894
+ end
907
895
 
908
- it "processes empty terms & definitions with external source" do
909
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
896
+ it "processes empty terms & definitions with external source" do
897
+ expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
910
898
  #{ASCIIDOC_BLANK_HDR}
911
899
 
912
900
  Foreword
@@ -914,27 +902,27 @@ RSpec.describe Asciidoctor::Standoc do
914
902
  [source="iso1234,iso5678"]
915
903
  == Terms and Definitions
916
904
 
917
- INPUT
918
- #{BLANK_HDR}
919
- <termdocsource bibitemid="iso1234"/><termdocsource bibitemid="iso5678"/>
920
- <preface><foreword id='_' obligation="informative">
921
- <title>Foreword</title>
922
- <p id="_">Foreword</p>
923
- </foreword></preface><sections>
924
- <terms id="_" obligation="normative">
925
- <title>Terms and definitions</title>
926
- <p id="_">For the purposes of this document,
927
- the terms and definitions given in <eref bibitemid="iso1234"/> and <eref bibitemid="iso5678"/> apply.</p>
905
+ INPUT
906
+ #{BLANK_HDR}
907
+ <termdocsource bibitemid="iso1234"/><termdocsource bibitemid="iso5678"/>
908
+ <preface><foreword id='_' obligation="informative">
909
+ <title>Foreword</title>
910
+ <p id="_">Foreword</p>
911
+ </foreword></preface><sections>
912
+ <terms id="_" obligation="normative">
913
+ <title>Terms and definitions</title>
914
+ <p id="_">For the purposes of this document,
915
+ the terms and definitions given in <eref bibitemid="iso1234"/> and <eref bibitemid="iso5678"/> apply.</p>
928
916
 
929
917
 
930
- </terms></sections>
931
- </standard-document>
918
+ </terms></sections>
919
+ </standard-document>
932
920
 
933
- OUTPUT
934
- end
921
+ OUTPUT
922
+ end
935
923
 
936
- it "processes term document sources in French" do
937
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
924
+ it "processes term document sources in French" do
925
+ expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
938
926
  = Document title
939
927
  Author
940
928
  :docfile: test.adoc
@@ -948,26 +936,26 @@ RSpec.describe Asciidoctor::Standoc do
948
936
  [source="iso1234,iso5678"]
949
937
  == Terms and Definitions
950
938
 
951
- INPUT
952
- #{BLANK_HDR.sub(%r{<language>en</language>}, "<language>fr</language>")}
953
- <termdocsource bibitemid="iso1234"/><termdocsource bibitemid="iso5678"/>
954
- <preface><foreword id='_' obligation="informative">
955
- <title>Avant-propos</title>
956
- <p id="_">Foreword</p>
957
- </foreword></preface><sections>
958
- <terms id="_" obligation="normative">
959
- <title>Terms et définitions</title>
960
- <p id="_">Pour les besoins du présent document, les termes et définitions de <eref bibitemid="iso1234"/> et <eref bibitemid="iso5678"/> s’appliquent.</p>
939
+ INPUT
940
+ #{BLANK_HDR.sub(%r{<language>en</language>}, '<language>fr</language>')}
941
+ <termdocsource bibitemid="iso1234"/><termdocsource bibitemid="iso5678"/>
942
+ <preface><foreword id='_' obligation="informative">
943
+ <title>Avant-propos</title>
944
+ <p id="_">Foreword</p>
945
+ </foreword></preface><sections>
946
+ <terms id="_" obligation="normative">
947
+ <title>Terms et définitions</title>
948
+ <p id="_">Pour les besoins du présent document, les termes et définitions de <eref bibitemid="iso1234"/> et <eref bibitemid="iso5678"/> s’appliquent.</p>
961
949
 
962
950
 
963
- </terms></sections>
964
- </standard-document>
951
+ </terms></sections>
952
+ </standard-document>
965
953
 
966
- OUTPUT
967
- end
954
+ OUTPUT
955
+ end
968
956
 
969
- it "processes term document sources in Chinese" do
970
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
957
+ it "processes term document sources in Chinese" do
958
+ expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
971
959
  = Document title
972
960
  Author
973
961
  :docfile: test.adoc
@@ -982,163 +970,158 @@ RSpec.describe Asciidoctor::Standoc do
982
970
  [source="iso1234,iso5678"]
983
971
  == Terms and Definitions
984
972
 
985
- INPUT
986
- #{BLANK_HDR.sub(%r{<language>en</language>}, "<language>zh</language>").sub(%r{<script>Latn</script>}, "<script>Hans</script>")}
987
- <termdocsource bibitemid="iso1234"/><termdocsource bibitemid="iso5678"/><preface><foreword id='_' obligation="informative">
988
- <title>前言</title>
989
- <p id="_">Foreword</p>
990
- </foreword></preface><sections>
991
- <terms id="_" obligation="normative">
992
- <title>术语和定义</title><p id="_"><eref bibitemid="iso1234"/>和<eref bibitemid="iso5678"/>界定的术语和定义适用于本文件。</p>
993
-
994
-
995
-
996
- </terms></sections>
997
- </standard-document>
998
- OUTPUT
999
- end
1000
-
1001
- it "warn about external source for terms & definitions that does not point anywhere" do
1002
- expect{Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)}.to output(/not referenced/).to_stderr
1003
- #{ASCIIDOC_BLANK_HDR}
1004
-
1005
- [source="iso712"]
1006
- == Terms and Definitions
1007
- === Term2
1008
- INPUT
1009
- end
1010
-
1011
- it "treats terminal terms subclause named as terms clause as a normal clause" do
1012
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
1013
- #{ASCIIDOC_BLANK_HDR}
1014
- [[tda]]
1015
- == Terms, definitions, symbols and abbreviations
1016
-
1017
- [[terms]]
1018
- === Terms and definitions
1019
-
1020
- === Symbols
1021
-
1022
- INPUT
1023
- #{BLANK_HDR}
1024
- <sections>
1025
- <terms id='tda' obligation='normative'>
1026
- <title>Terms, definitions and symbols</title>
1027
- <p id='_'>No terms and definitions are listed in this document.</p>
1028
- <clause id='terms' inline-header='false' obligation='normative'>
1029
- <title>Terms and definitions</title>
1030
- </clause>
1031
- <definitions id='_' obligation="normative" type="symbols">
1032
- <title>Symbols</title>
1033
- </definitions>
1034
- </terms>
1035
- </sections>
1036
- </standard-document>
1037
-
1038
- OUTPUT
1039
- end
1040
-
1041
- it "treats non-terminal terms subclause named as terms clause as a terms clause" do
1042
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
1043
- #{ASCIIDOC_BLANK_HDR}
1044
- == Scope
1045
-
1046
- [[tda]]
1047
- == Terms, definitions, symbols and abbreviations
1048
-
1049
- [[terms]]
1050
- === Terms and definitions
1051
-
1052
- [[terms-concepts]]
1053
- ==== Basic concepts
1054
-
1055
- [[term-date]]
1056
- ===== date
1057
-
1058
- _time_ (<<term-time>>) on the _calendar_ (<<term-calendar>>) _time scale_ (<<term-time-scale>>)
1059
-
1060
- INPUT
1061
- #{BLANK_HDR}
1062
- <sections>
1063
- <clause id='_' inline-header='false' obligation='normative' type="scope">
1064
- <title>Scope</title>
1065
- </clause>
1066
- <clause id='tda' obligation='normative'>
1067
- <title>Terms and definitions</title>
1068
- <p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
1069
- <clause id='terms' obligation='normative'>
1070
- <title>Terms and definitions</title>
1071
- <terms id='terms-concepts' obligation='normative'>
1072
- <title>Basic concepts</title>
1073
- <term id='term-date'>
1074
- <preferred>date</preferred>
1075
- <definition>
1076
- <p id='_'>
1077
- <em>time</em>
1078
- (
1079
- <xref target='term-time'/>
1080
- ) on the
1081
- <em>calendar</em>
1082
- (
1083
- <xref target='term-calendar'/>
1084
- )
1085
- <em>time scale</em>
1086
- (
1087
- <xref target='term-time-scale'/>
1088
- )
1089
- </p>
1090
- </definition>
1091
- </term>
1092
- </terms>
1093
- </clause>
1094
- </clause>
1095
- </sections>
1096
- </standard-document>
1097
- OUTPUT
1098
- end
1099
-
1100
- it "leaves alone special titles in preface or appendix" do
1101
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(strip_guid(<<~"OUTPUT"))
1102
- #{ASCIIDOC_BLANK_HDR}
1103
-
1104
- [.preface]
1105
- [[t1]]
1106
- == Terms and definitions
1107
-
1108
- [[t2]]
1109
- === Term1
1110
-
1111
- [appendix,language=fr]
1112
- [[sym]]
1113
- == Symbols and abbreviated terms
1114
-
1115
- [.appendix]
1116
- [[app]]
1117
- [bibliography]
1118
- == Normative Reference
1119
- INPUT
1120
- #{BLANK_HDR}
1121
- <preface>
1122
- <terms id='t1' obligation='normative'>
1123
- <title>Terms and definitions</title>
1124
- <term id='t2'>
1125
- <preferred>Term1</preferred>
1126
- </term>
1127
- </terms>
1128
- </preface>
1129
- <sections> </sections>
1130
- <annex id='_' obligation='' language='fr' script=''>
1131
- <definitions id='sym' language='fr' obligation="normative">
1132
- <title>Symbols and abbreviated terms</title>
1133
- </definitions>
1134
- </annex>
1135
- <annex id='_' obligation='' language='' script=''>
1136
- <references id='app' obligation='informative' normative="false">
1137
- <title>Bibliography</title>
1138
- </references>
1139
- </annex>
1140
- </standard-document>
1141
- OUTPUT
1142
- end
973
+ INPUT
974
+ #{BLANK_HDR.sub(%r{<language>en</language>}, '<language>zh</language>').sub(%r{<script>Latn</script>}, '<script>Hans</script>')}
975
+ <termdocsource bibitemid="iso1234"/><termdocsource bibitemid="iso5678"/><preface><foreword id='_' obligation="informative">
976
+ <title>前言</title>
977
+ <p id="_">Foreword</p>
978
+ </foreword></preface><sections>
979
+ <terms id="_" obligation="normative">
980
+ <title>术语和定义</title><p id="_"><eref bibitemid="iso1234"/>和<eref bibitemid="iso5678"/>界定的术语和定义适用于本文件。</p>
981
+ </terms></sections>
982
+ </standard-document>
983
+ OUTPUT
984
+ end
985
+
986
+ it "warn about external source for terms & definitions that does not point anywhere" do
987
+ expect { Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true) }.to output(/not referenced/).to_stderr
988
+ #{ASCIIDOC_BLANK_HDR}
989
+
990
+ [source="iso712"]
991
+ == Terms and Definitions
992
+ === Term2
993
+ INPUT
994
+ end
1143
995
 
996
+ it "treats terminal terms subclause named as terms clause as a normal clause" do
997
+ expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
998
+ #{ASCIIDOC_BLANK_HDR}
999
+ [[tda]]
1000
+ == Terms, definitions, symbols and abbreviations
1001
+
1002
+ [[terms]]
1003
+ === Terms and definitions
1004
+
1005
+ === Symbols
1006
+
1007
+ INPUT
1008
+ #{BLANK_HDR}
1009
+ <sections>
1010
+ <terms id='tda' obligation='normative'>
1011
+ <title>Terms, definitions and symbols</title>
1012
+ <p id='_'>No terms and definitions are listed in this document.</p>
1013
+ <clause id='terms' inline-header='false' obligation='normative'>
1014
+ <title>Terms and definitions</title>
1015
+ </clause>
1016
+ <definitions id='_' obligation="normative" type="symbols">
1017
+ <title>Symbols</title>
1018
+ </definitions>
1019
+ </terms>
1020
+ </sections>
1021
+ </standard-document>
1022
+ OUTPUT
1023
+ end
1024
+
1025
+ it "treats non-terminal terms subclause named as terms clause as a terms clause" do
1026
+ expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
1027
+ #{ASCIIDOC_BLANK_HDR}
1028
+ == Scope
1029
+
1030
+ [[tda]]
1031
+ == Terms, definitions, symbols and abbreviations
1032
+
1033
+ [[terms]]
1034
+ === Terms and definitions
1035
+
1036
+ [[terms-concepts]]
1037
+ ==== Basic concepts
1038
+
1039
+ [[term-date]]
1040
+ ===== date
1041
+
1042
+ _time_ (<<term-time>>) on the _calendar_ (<<term-calendar>>) _time scale_ (<<term-time-scale>>)
1043
+
1044
+ INPUT
1045
+ #{BLANK_HDR}
1046
+ <sections>
1047
+ <clause id='_' inline-header='false' obligation='normative' type="scope">
1048
+ <title>Scope</title>
1049
+ </clause>
1050
+ <clause id='tda' obligation='normative'>
1051
+ <title>Terms and definitions</title>
1052
+ <p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
1053
+ <clause id='terms' obligation='normative'>
1054
+ <title>Terms and definitions</title>
1055
+ <terms id='terms-concepts' obligation='normative'>
1056
+ <title>Basic concepts</title>
1057
+ <term id='term-date'>
1058
+ <preferred>date</preferred>
1059
+ <definition>
1060
+ <p id='_'>
1061
+ <em>time</em>
1062
+ (
1063
+ <xref target='term-time'/>
1064
+ ) on the
1065
+ <em>calendar</em>
1066
+ (
1067
+ <xref target='term-calendar'/>
1068
+ )
1069
+ <em>time scale</em>
1070
+ (
1071
+ <xref target='term-time-scale'/>
1072
+ )
1073
+ </p>
1074
+ </definition>
1075
+ </term>
1076
+ </terms>
1077
+ </clause>
1078
+ </clause>
1079
+ </sections>
1080
+ </standard-document>
1081
+ OUTPUT
1082
+ end
1083
+
1084
+ it "leaves alone special titles in preface or appendix" do
1085
+ expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(strip_guid(<<~"OUTPUT"))
1086
+ #{ASCIIDOC_BLANK_HDR}
1087
+
1088
+ [.preface]
1089
+ [[t1]]
1090
+ == Terms and definitions
1091
+
1092
+ [[t2]]
1093
+ === Term1
1094
+
1095
+ [appendix,language=fr]
1096
+ [[sym]]
1097
+ == Symbols and abbreviated terms
1098
+
1099
+ [.appendix]
1100
+ [[app]]
1101
+ [bibliography]
1102
+ == Normative Reference
1103
+ INPUT
1104
+ #{BLANK_HDR}
1105
+ <preface>
1106
+ <terms id='t1' obligation='normative'>
1107
+ <title>Terms and definitions</title>
1108
+ <term id='t2'>
1109
+ <preferred>Term1</preferred>
1110
+ </term>
1111
+ </terms>
1112
+ </preface>
1113
+ <sections> </sections>
1114
+ <annex id='_' obligation='' language='fr' script=''>
1115
+ <definitions id='sym' language='fr' obligation="normative">
1116
+ <title>Symbols and abbreviated terms</title>
1117
+ </definitions>
1118
+ </annex>
1119
+ <annex id='_' obligation='' language='' script=''>
1120
+ <references id='app' obligation='informative' normative="false">
1121
+ <title>Bibliography</title>
1122
+ </references>
1123
+ </annex>
1124
+ </standard-document>
1125
+ OUTPUT
1126
+ end
1144
1127
  end