metanorma-standoc 1.8.6 → 1.9.2

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.
Files changed (62) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +2 -0
  3. data/.rubocop.yml +5 -3
  4. data/Gemfile.devel +0 -0
  5. data/lib/asciidoctor/standoc/base.rb +41 -36
  6. data/lib/asciidoctor/standoc/biblio.rng +4 -6
  7. data/lib/asciidoctor/standoc/blocks.rb +44 -14
  8. data/lib/asciidoctor/standoc/blocks_notes.rb +41 -24
  9. data/lib/asciidoctor/standoc/cleanup.rb +33 -78
  10. data/lib/asciidoctor/standoc/cleanup_block.rb +77 -62
  11. data/lib/asciidoctor/standoc/cleanup_boilerplate.rb +51 -29
  12. data/lib/asciidoctor/standoc/cleanup_footnotes.rb +1 -0
  13. data/lib/asciidoctor/standoc/cleanup_image.rb +71 -0
  14. data/lib/asciidoctor/standoc/cleanup_maths.rb +37 -28
  15. data/lib/asciidoctor/standoc/cleanup_ref.rb +24 -15
  16. data/lib/asciidoctor/standoc/cleanup_ref_dl.rb +1 -1
  17. data/lib/asciidoctor/standoc/cleanup_reqt.rb +47 -0
  18. data/lib/asciidoctor/standoc/cleanup_section.rb +21 -15
  19. data/lib/asciidoctor/standoc/converter.rb +10 -3
  20. data/lib/asciidoctor/standoc/datamodel/plantuml_renderer.rb +67 -66
  21. data/lib/asciidoctor/standoc/front.rb +35 -18
  22. data/lib/asciidoctor/standoc/front_contributor.rb +5 -5
  23. data/lib/asciidoctor/standoc/inline.rb +1 -1
  24. data/lib/asciidoctor/standoc/isodoc.rng +304 -1
  25. data/lib/asciidoctor/standoc/lists.rb +4 -2
  26. data/lib/asciidoctor/standoc/macros.rb +50 -23
  27. data/lib/asciidoctor/standoc/macros_form.rb +63 -0
  28. data/lib/asciidoctor/standoc/ref.rb +87 -112
  29. data/lib/asciidoctor/standoc/ref_date_id.rb +62 -0
  30. data/lib/asciidoctor/standoc/ref_sect.rb +22 -19
  31. data/lib/asciidoctor/standoc/section.rb +3 -1
  32. data/lib/asciidoctor/standoc/terms.rb +27 -16
  33. data/lib/asciidoctor/standoc/utils.rb +35 -9
  34. data/lib/asciidoctor/standoc/validate.rb +30 -28
  35. data/lib/metanorma-standoc.rb +0 -1
  36. data/lib/metanorma/standoc/version.rb +5 -5
  37. data/metanorma-standoc.gemspec +11 -11
  38. data/spec/asciidoctor/base_spec.rb +78 -8
  39. data/spec/asciidoctor/blocks_spec.rb +832 -727
  40. data/spec/asciidoctor/cleanup_sections_spec.rb +52 -15
  41. data/spec/asciidoctor/cleanup_spec.rb +1860 -1874
  42. data/spec/asciidoctor/inline_spec.rb +272 -273
  43. data/spec/asciidoctor/isobib_cache_spec.rb +406 -358
  44. data/spec/asciidoctor/macros_spec.rb +539 -437
  45. data/spec/asciidoctor/macros_yaml2text_spec.rb +1 -1
  46. data/spec/asciidoctor/refs_spec.rb +135 -7
  47. data/spec/asciidoctor/section_spec.rb +743 -690
  48. data/spec/assets/html-override.css +1 -0
  49. data/spec/assets/word-override.css +1 -0
  50. data/spec/spec_helper.rb +11 -9
  51. data/spec/vcr_cassettes/dated_iso_ref_joint_iso_iec.yml +60 -60
  52. data/spec/vcr_cassettes/isobib_get_123.yml +14 -14
  53. data/spec/vcr_cassettes/isobib_get_123_1.yml +30 -30
  54. data/spec/vcr_cassettes/isobib_get_123_1_fr.yml +42 -42
  55. data/spec/vcr_cassettes/isobib_get_123_2001.yml +15 -15
  56. data/spec/vcr_cassettes/isobib_get_124.yml +15 -15
  57. data/spec/vcr_cassettes/rfcbib_get_rfc8341.yml +14 -14
  58. data/spec/vcr_cassettes/separates_iev_citations_by_top_level_clause.yml +53 -49
  59. metadata +72 -68
  60. data/.rubocop.ribose.yml +0 -66
  61. data/.rubocop.tb.yml +0 -650
  62. data/spec/asciidoctor/macros_lutaml_spec.rb +0 -80
@@ -1,26 +1,31 @@
1
1
  require "spec_helper"
2
2
  require "open3"
3
3
 
4
+ OPTIONS = [backend: :standoc, header_footer: true].freeze
5
+
4
6
  RSpec.describe Asciidoctor::Standoc do
5
- it "processes format-specific pass blocks" do
6
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
7
+ it "processes format-specific pass blocks" do
8
+ input = <<~INPUT
7
9
  #{ASCIIDOC_BLANK_HDR}
8
-
10
+
9
11
  [format="rfc,html"]
10
12
  ++++
11
13
  <abc>X &gt; Y</abc>
12
14
  ++++
13
15
  INPUT
14
- #{BLANK_HDR}
15
- <sections>
16
- <passthrough formats='rfc,html'>&lt;abc&gt;X &gt; Y&lt;/abc&gt;</passthrough>
17
- </sections>
18
- </standard-document>
16
+ output = <<~OUTPUT
17
+ #{BLANK_HDR}
18
+ <sections>
19
+ <passthrough formats='rfc,html'>&lt;abc&gt;X &gt; Y&lt;/abc&gt;</passthrough>
20
+ </sections>
21
+ </standard-document>
19
22
  OUTPUT
23
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
24
+ .to be_equivalent_to xmlpp(output)
20
25
  end
21
26
 
22
27
  it "processes Metanorma XML pass blocks" do
23
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
28
+ input = <<~INPUT
24
29
  #{ASCIIDOC_BLANK_HDR}
25
30
 
26
31
  ++++
@@ -31,16 +36,19 @@ RSpec.describe Asciidoctor::Standoc do
31
36
  Y</abc>
32
37
  ++++
33
38
  INPUT
34
- #{BLANK_HDR}
35
- <sections>
36
- <abc>X &gt; Y</abc>
37
- </sections>
38
- </standard-document>
39
+ output = <<~OUTPUT
40
+ #{BLANK_HDR}
41
+ <sections>
42
+ <abc>X &gt; Y</abc>
43
+ </sections>
44
+ </standard-document>
39
45
  OUTPUT
46
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
47
+ .to be_equivalent_to xmlpp(output)
40
48
  end
41
49
 
42
50
  it "processes open blocks" do
43
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
51
+ input = <<~INPUT
44
52
  #{ASCIIDOC_BLANK_HDR}
45
53
  --
46
54
  x
@@ -50,23 +58,26 @@ RSpec.describe Asciidoctor::Standoc do
50
58
  z
51
59
  --
52
60
  INPUT
53
- #{BLANK_HDR}
54
- <sections><p id="_">x</p>
55
- <p id="_">y</p>
56
- <p id="_">z</p></sections>
57
- </standard-document>
61
+ output = <<~OUTPUT
62
+ #{BLANK_HDR}
63
+ <sections><p id="_">x</p>
64
+ <p id="_">y</p>
65
+ <p id="_">z</p></sections>
66
+ </standard-document>
58
67
  OUTPUT
68
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
69
+ .to be_equivalent_to xmlpp(output)
59
70
  end
60
71
 
61
72
  it "processes stem blocks" do
62
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
73
+ input = <<~INPUT
63
74
  #{ASCIIDOC_BLANK_HDR}
64
75
 
65
76
  [[ABC]]
66
77
  [stem%inequality,number=3,keep-with-next=true,keep-lines-together=true]
67
78
  ++++
68
- r = 1 %
69
- r = 1 %
79
+ r = 1 %
80
+ r = 1 %
70
81
  ++++
71
82
 
72
83
  [stem%unnumbered]
@@ -85,155 +96,158 @@ RSpec.describe Asciidoctor::Standoc do
85
96
  ++++
86
97
 
87
98
  INPUT
88
- #{BLANK_HDR}
89
- <sections>
90
- <formula id='ABC' number='3' keep-with-next='true' keep-lines-together='true' inequality='true'>
91
- <stem type='MathML'>
92
- <math xmlns='http://www.w3.org/1998/Math/MathML'>
93
- <mi>r</mi>
94
- <mo>=</mo>
95
- <mn>1</mn>
96
- <mi>%</mi>
97
- <mi>r</mi>
98
- <mo>=</mo>
99
- <mn>1</mn>
100
- <mi>%</mi>
101
- </math>
102
- </stem>
103
- </formula>
104
- <formula id='_' unnumbered='true'>
105
- <stem type='MathML'>
106
- <math xmlns='http://www.w3.org/1998/Math/MathML'>
107
- <msub>
108
- <mrow>
109
- <mrow>
110
- <mi mathvariant='bold-italic'>F</mi>
111
- </mrow>
112
- </mrow>
113
- <mrow>
114
- <mrow>
115
- <mi mathvariant='bold-italic'>Α</mi>
116
- </mrow>
117
- </mrow>
118
- </msub>
119
- </math>
120
- </stem>
121
- </formula>
122
- <formula id='_' subsequence='A'>
123
- <stem type='MathML'>
124
- <math xmlns='http://www.w3.org/1998/Math/MathML'>
125
- <mrow>
126
- <mi>M</mi>
127
- <mo>=</mo>
128
- <mo>[</mo>
129
- <mtable>
130
- <mtr>
131
- <mtd>
132
- <mrow>
133
- <mo>−</mo>
134
- <mi>sin</mi>
135
- </mrow>
136
- <msub>
137
- <mi>λ</mi>
138
- <mn>0</mn>
139
- </msub>
140
- </mtd>
141
- <mtd>
142
- <mi>cos</mi>
143
- <msub>
144
- <mi>λ</mi>
145
- <mn>0</mn>
146
- </msub>
147
- </mtd>
148
- <mtd>
149
- <mn>0</mn>
150
- </mtd>
151
- </mtr>
152
- <mtr>
153
- <mtd>
154
- <mrow>
155
- <mo>−</mo>
156
- <mi>sin</mi>
157
- </mrow>
158
- <msub>
159
- <mi>φ</mi>
160
- <mn>0</mn>
161
- </msub>
162
- <mi>cos</mi>
163
- <msub>
164
- <mi>λ</mi>
165
- <mn>0</mn>
166
- </msub>
167
- </mtd>
168
- <mtd>
169
- <mrow>
170
- <mo>−</mo>
171
- <mi>sin</mi>
172
- </mrow>
173
- <msub>
174
- <mi>φ</mi>
175
- <mn>0</mn>
176
- </msub>
177
- <mi>sin</mi>
178
- <msub>
179
- <mi>λ</mi>
180
- <mn>0</mn>
181
- </msub>
182
- </mtd>
183
- <mtd>
184
- <mi>cos</mi>
185
- <msub>
186
- <mi>φ</mi>
187
- <mn>0</mn>
188
- </msub>
189
- </mtd>
190
- </mtr>
191
- <mtr>
192
- <mtd>
193
- <mi>cos</mi>
194
- <msub>
195
- <mi>φ</mi>
196
- <mn>0</mn>
197
- </msub>
198
- <mi>cos</mi>
199
- <msub>
200
- <mi>λ</mi>
201
- <mn>0</mn>
202
- </msub>
203
- </mtd>
204
- <mtd>
205
- <mi>cos</mi>
206
- <msub>
207
- <mi>φ</mi>
208
- <mn>0</mn>
209
- </msub>
210
- <mi>sin</mi>
211
- <msub>
212
- <mi>λ</mi>
213
- <mn>0</mn>
214
- </msub>
215
- </mtd>
216
- <mtd>
217
- <mi>sin</mi>
218
- <msub>
219
- <mi>φ</mi>
220
- <mn>0</mn>
221
- </msub>
222
- </mtd>
223
- </mtr>
224
- </mtable>
225
- <mo>]</mo>
226
- </mrow>
227
- </math>
228
- </stem>
229
- </formula>
230
- </sections>
231
- </standard-document>
99
+ output = <<~OUTPUT
100
+ #{BLANK_HDR}
101
+ <sections>
102
+ <formula id='ABC' number='3' keep-with-next='true' keep-lines-together='true' inequality='true'>
103
+ <stem type='MathML'>
104
+ <math xmlns='http://www.w3.org/1998/Math/MathML'>
105
+ <mi>r</mi>
106
+ <mo>=</mo>
107
+ <mn>1</mn>
108
+ <mi>%</mi>
109
+ <mi>r</mi>
110
+ <mo>=</mo>
111
+ <mn>1</mn>
112
+ <mi>%</mi>
113
+ </math>
114
+ </stem>
115
+ </formula>
116
+ <formula id='_' unnumbered='true'>
117
+ <stem type='MathML'>
118
+ <math xmlns='http://www.w3.org/1998/Math/MathML'>
119
+ <msub>
120
+ <mrow>
121
+ <mrow>
122
+ <mi mathvariant='bold-italic'>F</mi>
123
+ </mrow>
124
+ </mrow>
125
+ <mrow>
126
+ <mrow>
127
+ <mi mathvariant='bold-italic'>Α</mi>
128
+ </mrow>
129
+ </mrow>
130
+ </msub>
131
+ </math>
132
+ </stem>
133
+ </formula>
134
+ <formula id='_' subsequence='A'>
135
+ <stem type='MathML'>
136
+ <math xmlns='http://www.w3.org/1998/Math/MathML'>
137
+ <mrow>
138
+ <mi>M</mi>
139
+ <mo>=</mo>
140
+ <mo>[</mo>
141
+ <mtable>
142
+ <mtr>
143
+ <mtd>
144
+ <mrow>
145
+ <mo>−</mo>
146
+ <mi>sin</mi>
147
+ </mrow>
148
+ <msub>
149
+ <mi>λ</mi>
150
+ <mn>0</mn>
151
+ </msub>
152
+ </mtd>
153
+ <mtd>
154
+ <mi>cos</mi>
155
+ <msub>
156
+ <mi>λ</mi>
157
+ <mn>0</mn>
158
+ </msub>
159
+ </mtd>
160
+ <mtd>
161
+ <mn>0</mn>
162
+ </mtd>
163
+ </mtr>
164
+ <mtr>
165
+ <mtd>
166
+ <mrow>
167
+ <mo>−</mo>
168
+ <mi>sin</mi>
169
+ </mrow>
170
+ <msub>
171
+ <mi>φ</mi>
172
+ <mn>0</mn>
173
+ </msub>
174
+ <mi>cos</mi>
175
+ <msub>
176
+ <mi>λ</mi>
177
+ <mn>0</mn>
178
+ </msub>
179
+ </mtd>
180
+ <mtd>
181
+ <mrow>
182
+ <mo>−</mo>
183
+ <mi>sin</mi>
184
+ </mrow>
185
+ <msub>
186
+ <mi>φ</mi>
187
+ <mn>0</mn>
188
+ </msub>
189
+ <mi>sin</mi>
190
+ <msub>
191
+ <mi>λ</mi>
192
+ <mn>0</mn>
193
+ </msub>
194
+ </mtd>
195
+ <mtd>
196
+ <mi>cos</mi>
197
+ <msub>
198
+ <mi>φ</mi>
199
+ <mn>0</mn>
200
+ </msub>
201
+ </mtd>
202
+ </mtr>
203
+ <mtr>
204
+ <mtd>
205
+ <mi>cos</mi>
206
+ <msub>
207
+ <mi>φ</mi>
208
+ <mn>0</mn>
209
+ </msub>
210
+ <mi>cos</mi>
211
+ <msub>
212
+ <mi>λ</mi>
213
+ <mn>0</mn>
214
+ </msub>
215
+ </mtd>
216
+ <mtd>
217
+ <mi>cos</mi>
218
+ <msub>
219
+ <mi>φ</mi>
220
+ <mn>0</mn>
221
+ </msub>
222
+ <mi>sin</mi>
223
+ <msub>
224
+ <mi>λ</mi>
225
+ <mn>0</mn>
226
+ </msub>
227
+ </mtd>
228
+ <mtd>
229
+ <mi>sin</mi>
230
+ <msub>
231
+ <mi>φ</mi>
232
+ <mn>0</mn>
233
+ </msub>
234
+ </mtd>
235
+ </mtr>
236
+ </mtable>
237
+ <mo>]</mo>
238
+ </mrow>
239
+ </math>
240
+ </stem>
241
+ </formula>
242
+ </sections>
243
+ </standard-document>
232
244
  OUTPUT
245
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
246
+ .to be_equivalent_to xmlpp(output)
233
247
  end
234
-
235
- it "ignores review blocks unless document is in draft mode" do
236
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
248
+
249
+ it "ignores review blocks unless document is in draft mode" do
250
+ input = <<~INPUT
237
251
  #{ASCIIDOC_BLANK_HDR}
238
252
  [[foreword]]
239
253
  .Foreword
@@ -245,16 +259,17 @@ RSpec.describe Asciidoctor::Standoc do
245
259
 
246
260
  For further information on the Foreword, see *ISO/IEC Directives, Part 2, 2016, Clause 12.*
247
261
  ****
248
- INPUT
249
- #{BLANK_HDR}
250
- <sections><p id="foreword">Foreword</p>
251
- </sections>
252
- </standard-document>
253
- OUTPUT
254
- end
262
+ INPUT
263
+ output = <<~OUTPUT
264
+ #{BLANK_HDR}
265
+ <sections><p id="foreword">Foreword</p>
266
+ </sections>
267
+ </standard-document>
268
+ OUTPUT
269
+ end
255
270
 
256
271
  it "processes review blocks if document is in draft mode" do
257
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
272
+ input = <<~INPUT
258
273
  = Document title
259
274
  Author
260
275
  :docfile: test.adoc
@@ -272,7 +287,8 @@ RSpec.describe Asciidoctor::Standoc do
272
287
 
273
288
  For further information on the Foreword, see *ISO/IEC Directives, Part 2, 2016, Clause 12.*
274
289
  ****
275
- INPUT
290
+ INPUT
291
+ output = <<~OUTPUT
276
292
  <standard-document xmlns="https://www.metanorma.org/ns/standoc" type="semantic" version="#{Metanorma::Standoc::VERSION}">
277
293
  <bibdata type="standard">
278
294
  <title language="en" format="text/plain">Document title</title>
@@ -296,11 +312,13 @@ RSpec.describe Asciidoctor::Standoc do
296
312
  <p id="_">For further information on the Foreword, see <strong>ISO/IEC Directives, Part 2, 2016, Clause 12.</strong></p></review></sections>
297
313
  </standard-document>
298
314
 
299
- OUTPUT
315
+ OUTPUT
316
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
317
+ .to be_equivalent_to xmlpp(output)
300
318
  end
301
319
 
302
320
  it "processes term notes" do
303
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
321
+ input = <<~INPUT
304
322
  #{ASCIIDOC_BLANK_HDR}
305
323
  == Terms and Definitions
306
324
 
@@ -312,29 +330,32 @@ RSpec.describe Asciidoctor::Standoc do
312
330
  ====
313
331
  XYZ
314
332
  ====
315
- INPUT
316
- #{BLANK_HDR}
317
- <sections>
318
- <terms id="_" obligation="normative">
319
- <title>Terms and definitions</title>
320
- <p id="_">For the purposes of this document, the following terms and definitions apply.</p>
321
- <term id="term-term1">
322
- <preferred>Term1</preferred>
323
- <termnote id="_">
324
- <p id="_">This is a note</p>
325
- </termnote>
326
- <termnote id='_'>
327
- <p id='_'>XYZ</p>
328
- </termnote>
329
- </term>
330
- </terms>
331
- </sections>
332
- </standard-document>
333
- OUTPUT
333
+ INPUT
334
+ output = <<~OUTPUT
335
+ #{BLANK_HDR}
336
+ <sections>
337
+ <terms id="_" obligation="normative">
338
+ <title>Terms and definitions</title>
339
+ <p id="_">For the purposes of this document, the following terms and definitions apply.</p>
340
+ <term id="term-term1">
341
+ <preferred>Term1</preferred>
342
+ <termnote id="_">
343
+ <p id="_">This is a note</p>
344
+ </termnote>
345
+ <termnote id='_'>
346
+ <p id='_'>XYZ</p>
347
+ </termnote>
348
+ </term>
349
+ </terms>
350
+ </sections>
351
+ </standard-document>
352
+ OUTPUT
353
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
354
+ .to be_equivalent_to xmlpp(output)
334
355
  end
335
356
 
336
- it "processes term notes as plain notes in nonterm clauses" do
337
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
357
+ it "processes term notes as plain notes in nonterm clauses" do
358
+ input = <<~INPUT
338
359
  #{ASCIIDOC_BLANK_HDR}
339
360
  == Terms and Definitions
340
361
 
@@ -348,33 +369,35 @@ RSpec.describe Asciidoctor::Standoc do
348
369
  === Term1
349
370
 
350
371
  NOTE: This is a note
351
- INPUT
352
- #{BLANK_HDR}
353
- <sections>
354
- <terms id="_" obligation="normative">
355
- <title>Terms and definitions</title>
356
- <p id="_">No terms and definitions are listed in this document.</p>
357
- <note id='_'>
358
- <p id='_'>This is not a termnote</p>
359
- </note>
360
- <example id='_'>
361
- <p id='_'>This is not a termexample</p>
362
- </example>
363
- <clause id="_" inline-header="false" obligation="normative">
364
- <title>Term1</title>
365
- <note id="_">
366
- <p id="_">This is a note</p>
367
- </note>
368
- </clause>
369
- </terms>
370
- </sections>
371
- </standard-document>
372
-
373
- OUTPUT
372
+ INPUT
373
+ output = <<~OUTPUT
374
+ #{BLANK_HDR}
375
+ <sections>
376
+ <terms id="_" obligation="normative">
377
+ <title>Terms and definitions</title>
378
+ <p id="_">No terms and definitions are listed in this document.</p>
379
+ <note id='_'>
380
+ <p id='_'>This is not a termnote</p>
381
+ </note>
382
+ <example id='_'>
383
+ <p id='_'>This is not a termexample</p>
384
+ </example>
385
+ <clause id="_" inline-header="false" obligation="normative">
386
+ <title>Term1</title>
387
+ <note id="_">
388
+ <p id="_">This is a note</p>
389
+ </note>
390
+ </clause>
391
+ </terms>
392
+ </sections>
393
+ </standard-document>
394
+ OUTPUT
395
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
396
+ .to be_equivalent_to xmlpp(output)
374
397
  end
375
398
 
376
- it "processes term notes as plain notes in definitions subclauses of terms & definitions" do
377
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
399
+ it "processes term notes as plain notes in definitions subclauses of terms & definitions" do
400
+ input = <<~INPUT
378
401
  #{ASCIIDOC_BLANK_HDR}
379
402
  == Terms and Definitions
380
403
 
@@ -383,28 +406,30 @@ RSpec.describe Asciidoctor::Standoc do
383
406
  === Symbols
384
407
 
385
408
  NOTE: This is a note
386
- INPUT
387
- #{BLANK_HDR}
388
- <sections>
389
- <terms id="_" obligation="normative"><title>Terms, definitions and symbols</title>
390
- <p id="_">For the purposes of this document, the following terms and definitions apply.</p>
391
- <term id="term-term1">
392
- <preferred>Term1</preferred>
393
- </term>
394
- <definitions id="_" obligation="normative" type="symbols">
395
- <title>Symbols</title>
396
- <note id="_">
397
- <p id="_">This is a note</p>
398
- </note>
399
- </definitions></terms>
400
- </sections>
401
- </standard-document>
402
-
403
- OUTPUT
409
+ INPUT
410
+ output = <<~OUTPUT
411
+ #{BLANK_HDR}
412
+ <sections>
413
+ <terms id="_" obligation="normative"><title>Terms, definitions and symbols</title>
414
+ <p id="_">For the purposes of this document, the following terms and definitions apply.</p>
415
+ <term id="term-term1">
416
+ <preferred>Term1</preferred>
417
+ </term>
418
+ <definitions id="_" obligation="normative" type="symbols">
419
+ <title>Symbols</title>
420
+ <note id="_">
421
+ <p id="_">This is a note</p>
422
+ </note>
423
+ </definitions></terms>
424
+ </sections>
425
+ </standard-document>
426
+ OUTPUT
427
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
428
+ .to be_equivalent_to xmlpp(output)
404
429
  end
405
430
 
406
- it "processes notes" do
407
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
431
+ it "processes notes" do
432
+ input = <<~INPUT
408
433
  #{ASCIIDOC_BLANK_HDR}
409
434
  NOTE: This is a note
410
435
 
@@ -417,31 +442,34 @@ RSpec.describe Asciidoctor::Standoc do
417
442
  ====
418
443
  XYZ
419
444
  ====
420
- INPUT
421
- #{BLANK_HDR}
422
- <preface><foreword id="_" obligation="informative">
423
- <title>Foreword</title>
424
- <note id="_">
425
- <p id="_">This is a note</p>
426
- </note>
427
- </foreword></preface><sections>
428
- <note id='_' number="7" subsequence="A" keep-with-next="true" keep-lines-together="true" type="classified">
429
- <p id='_'>XYZ</p>
430
- </note>
431
- <clause id="_" inline-header="false" obligation="normative">
432
- <title>Clause 1</title>
433
- <note id="ABC">
434
- <p id="_">This is a note</p>
435
- </note>
436
- </clause></sections>
437
-
438
- </standard-document>
445
+ INPUT
446
+ output = <<~OUTPUT
447
+ #{BLANK_HDR}
448
+ <preface><foreword id="_" obligation="informative">
449
+ <title>Foreword</title>
450
+ <note id="_">
451
+ <p id="_">This is a note</p>
452
+ </note>
453
+ </foreword></preface><sections>
454
+ <note id='_' number="7" subsequence="A" keep-with-next="true" keep-lines-together="true" type="classified">
455
+ <p id='_'>XYZ</p>
456
+ </note>
457
+ <clause id="_" inline-header="false" obligation="normative">
458
+ <title>Clause 1</title>
459
+ <note id="ABC">
460
+ <p id="_">This is a note</p>
461
+ </note>
462
+ </clause></sections>
463
+
464
+ </standard-document>
439
465
 
440
- OUTPUT
441
- end
466
+ OUTPUT
467
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
468
+ .to be_equivalent_to xmlpp(output)
469
+ end
442
470
 
443
- it "processes literals" do
444
- expect((strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to (<<~"OUTPUT")
471
+ it "processes literals" do
472
+ input = <<~INPUT
445
473
  #{ASCIIDOC_BLANK_HDR}
446
474
 
447
475
  [[ABC]]
@@ -450,7 +478,8 @@ RSpec.describe Asciidoctor::Standoc do
450
478
  <LITERAL>
451
479
  FIGURATIVE
452
480
  ....
453
- INPUT
481
+ INPUT
482
+ output = <<~OUTPUT
454
483
  #{BLANK_HDR}
455
484
  <sections>
456
485
  <figure id="ABC" keep-with-next="true" keep-lines-together="true">
@@ -461,14 +490,17 @@ RSpec.describe Asciidoctor::Standoc do
461
490
  </sections>
462
491
  </standard-document>
463
492
 
464
- OUTPUT
465
- end
493
+ OUTPUT
494
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
495
+ .to be_equivalent_to xmlpp(output)
496
+ end
466
497
 
467
- it "processes simple admonitions with Asciidoc names" do
468
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
498
+ it "processes simple admonitions with Asciidoc names" do
499
+ input = <<~INPUT
469
500
  #{ASCIIDOC_BLANK_HDR}
470
501
  CAUTION: Only use paddy or parboiled rice for the determination of husked rice yield.
471
- INPUT
502
+ INPUT
503
+ output = <<~OUTPUT
472
504
  #{BLANK_HDR}
473
505
  <sections>
474
506
  <admonition id="_" type="caution">
@@ -477,14 +509,15 @@ RSpec.describe Asciidoctor::Standoc do
477
509
  </sections>
478
510
  </standard-document>
479
511
 
480
- OUTPUT
481
- end
482
-
512
+ OUTPUT
513
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
514
+ .to be_equivalent_to xmlpp(output)
515
+ end
483
516
 
484
- it "processes complex admonitions with non-Asciidoc names" do
485
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
517
+ it "processes complex admonitions with non-Asciidoc names" do
518
+ input = <<~INPUT
486
519
  #{ASCIIDOC_BLANK_HDR}
487
-
520
+
488
521
  [[ABC]]
489
522
  [CAUTION,type=Safety Precautions,keep-with-next="true",keep-lines-together="true"]
490
523
  .Precautions
@@ -495,7 +528,8 @@ RSpec.describe Asciidoctor::Standoc do
495
528
  . More than two glasses of orange juice in 24 hours makes them howl in harmony with alarms and sirens.
496
529
  . Celery makes them sad.
497
530
  ====
498
- INPUT
531
+ INPUT
532
+ output = <<~OUTPUT
499
533
  #{BLANK_HDR}
500
534
  <sections>
501
535
  <admonition id="ABC" type="safety precautions" keep-with-next="true" keep-lines-together="true">
@@ -514,11 +548,13 @@ RSpec.describe Asciidoctor::Standoc do
514
548
  </sections>
515
549
  </standard-document>
516
550
 
517
- OUTPUT
518
- end
551
+ OUTPUT
552
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
553
+ .to be_equivalent_to xmlpp(output)
554
+ end
519
555
 
520
- it "processes term examples" do
521
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
556
+ it "processes term examples" do
557
+ input = <<~INPUT
522
558
  #{ASCIIDOC_BLANK_HDR}
523
559
  == Terms and Definitions
524
560
 
@@ -527,26 +563,28 @@ RSpec.describe Asciidoctor::Standoc do
527
563
  [[ABC]]
528
564
  [example]
529
565
  This is an example
530
- INPUT
531
- #{BLANK_HDR}
532
- <sections>
533
- <terms id="_" obligation="normative">
534
- <title>Terms and definitions</title>
535
- <p id="_">For the purposes of this document, the following terms and definitions apply.</p>
536
- <term id="term-term1">
537
- <preferred>Term1</preferred>
538
-
539
- <termexample id="ABC">
540
- <p id="_">This is an example</p>
541
- </termexample></term>
542
- </terms>
543
- </sections>
544
- </standard-document>
545
- OUTPUT
546
- end
547
-
548
- it "processes term examples as plain examples in nonterm clauses" do
549
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
566
+ INPUT
567
+ output = <<~OUTPUT
568
+ #{BLANK_HDR}
569
+ <sections>
570
+ <terms id="_" obligation="normative">
571
+ <title>Terms and definitions</title>
572
+ <p id="_">For the purposes of this document, the following terms and definitions apply.</p>
573
+ <term id="term-term1">
574
+ <preferred>Term1</preferred>
575
+ <termexample id="ABC">
576
+ <p id="_">This is an example</p>
577
+ </termexample></term>
578
+ </terms>
579
+ </sections>
580
+ </standard-document>
581
+ OUTPUT
582
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
583
+ .to be_equivalent_to xmlpp(output)
584
+ end
585
+
586
+ it "processes term examples as plain examples in nonterm clauses" do
587
+ input = <<~INPUT
550
588
  #{ASCIIDOC_BLANK_HDR}
551
589
  == Terms and Definitions
552
590
 
@@ -555,26 +593,29 @@ RSpec.describe Asciidoctor::Standoc do
555
593
 
556
594
  [example]
557
595
  This is an example
558
- INPUT
559
- #{BLANK_HDR}
560
- <sections>
561
- <terms id="_" obligation="normative">
562
- <title>Terms and definitions</title>
563
- <p id="_">No terms and definitions are listed in this document.</p>
564
- <clause id="_" inline-header="false" obligation="normative">
565
- <title>Term1</title>
566
- <example id="_">
567
- <p id="_">This is an example</p>
568
- </example>
569
- </clause>
570
- </terms>
571
- </sections>
572
- </standard-document>
573
- OUTPUT
574
- end
596
+ INPUT
597
+ output = <<~OUTPUT
598
+ #{BLANK_HDR}
599
+ <sections>
600
+ <terms id="_" obligation="normative">
601
+ <title>Terms and definitions</title>
602
+ <p id="_">No terms and definitions are listed in this document.</p>
603
+ <clause id="_" inline-header="false" obligation="normative">
604
+ <title>Term1</title>
605
+ <example id="_">
606
+ <p id="_">This is an example</p>
607
+ </example>
608
+ </clause>
609
+ </terms>
610
+ </sections>
611
+ </standard-document>
612
+ OUTPUT
613
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
614
+ .to be_equivalent_to xmlpp(output)
615
+ end
575
616
 
576
617
  it "processes term examples as plain examples in definitions subclauses of terms & definitions" do
577
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
618
+ input = <<~INPUT
578
619
  #{ASCIIDOC_BLANK_HDR}
579
620
  == Terms and Definitions
580
621
 
@@ -584,27 +625,29 @@ RSpec.describe Asciidoctor::Standoc do
584
625
 
585
626
  [example]
586
627
  This is an example
587
- INPUT
588
- #{BLANK_HDR}
589
- <sections>
590
- <terms id="_" obligation="normative"><title>Terms, definitions and symbols</title>
591
- <p id="_">For the purposes of this document, the following terms and definitions apply.</p><term id="term-term1">
592
- <preferred>Term1</preferred>
593
- </term>
594
- <definitions id="_" obligation="normative" type="symbols">
595
- <title>Symbols</title>
596
- <example id="_">
597
- <p id="_">This is an example</p>
598
- </example>
599
- </definitions></terms>
600
- </sections>
601
- </standard-document>
602
- OUTPUT
628
+ INPUT
629
+ output = <<~OUTPUT
630
+ #{BLANK_HDR}
631
+ <sections>
632
+ <terms id="_" obligation="normative"><title>Terms, definitions and symbols</title>
633
+ <p id="_">For the purposes of this document, the following terms and definitions apply.</p><term id="term-term1">
634
+ <preferred>Term1</preferred>
635
+ </term>
636
+ <definitions id="_" obligation="normative" type="symbols">
637
+ <title>Symbols</title>
638
+ <example id="_">
639
+ <p id="_">This is an example</p>
640
+ </example>
641
+ </definitions></terms>
642
+ </sections>
643
+ </standard-document>
644
+ OUTPUT
645
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
646
+ .to be_equivalent_to xmlpp(output)
603
647
  end
604
648
 
605
-
606
- it "processes examples" do
607
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
649
+ it "processes examples" do
650
+ input = <<~INPUT
608
651
  #{ASCIIDOC_BLANK_HDR}
609
652
 
610
653
  [[ABC]]
@@ -625,7 +668,8 @@ RSpec.describe Asciidoctor::Standoc do
625
668
  ====
626
669
  This is yet another example
627
670
  ====
628
- INPUT
671
+ INPUT
672
+ output = <<~OUTPUT
629
673
  #{BLANK_HDR}
630
674
  <sections>
631
675
  <example id="ABC" subsequence="A" keep-with-next='true' keep-lines-together='next'>
@@ -636,16 +680,19 @@ RSpec.describe Asciidoctor::Standoc do
636
680
  <example id="_" number="3"><p id="_">This is yet another example</p></example>
637
681
  </sections>
638
682
  </standard-document>
639
- OUTPUT
640
- end
683
+ OUTPUT
684
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
685
+ .to be_equivalent_to xmlpp(output)
686
+ end
641
687
 
642
- it "processes preambles" do
643
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
688
+ it "processes preambles" do
689
+ input = <<~INPUT
644
690
  #{ASCIIDOC_BLANK_HDR}
645
691
  This is a preamble
646
692
 
647
693
  == Section 1
648
- INPUT
694
+ INPUT
695
+ output = <<~OUTPUT
649
696
  #{BLANK_HDR}
650
697
  <preface><foreword id="_" obligation="informative">
651
698
  <title>Foreword</title>
@@ -655,17 +702,20 @@ RSpec.describe Asciidoctor::Standoc do
655
702
  <title>Section 1</title>
656
703
  </clause></sections>
657
704
  </standard-document>
658
- OUTPUT
659
- end
705
+ OUTPUT
706
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
707
+ .to be_equivalent_to xmlpp(output)
708
+ end
660
709
 
661
- it "processes preambles with titles" do
662
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
710
+ it "processes preambles with titles" do
711
+ input = <<~INPUT
663
712
  #{ASCIIDOC_BLANK_HDR}
664
713
  .Preamble
665
714
  This is a preamble
666
715
 
667
716
  == Section 1
668
- INPUT
717
+ INPUT
718
+ output = <<~OUTPUT
669
719
  #{BLANK_HDR}
670
720
  <preface><foreword id="_" obligation="informative">
671
721
  <title>Foreword</title>
@@ -675,11 +725,13 @@ RSpec.describe Asciidoctor::Standoc do
675
725
  <title>Section 1</title>
676
726
  </clause></sections>
677
727
  </standard-document>
678
- OUTPUT
679
- end
728
+ OUTPUT
729
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
730
+ .to be_equivalent_to xmlpp(output)
731
+ end
680
732
 
681
733
  it "processes subfigures" do
682
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
734
+ input = <<~INPUT
683
735
  #{ASCIIDOC_BLANK_HDR}
684
736
  [[figureC-2]]
685
737
  .Stages of gelatinization
@@ -694,27 +746,30 @@ RSpec.describe Asciidoctor::Standoc do
694
746
  image::spec/examples/rice_images/rice_image3_3.png[]
695
747
  ====
696
748
  INPUT
697
- #{BLANK_HDR}
698
- <sections>
699
- <figure id="figureC-2"><name>Stages of gelatinization</name><figure id="_">
700
- <name>Initial stages: No grains are fully gelatinized (ungelatinized starch granules are visible inside the kernels)</name>
701
- <image src="spec/examples/rice_images/rice_image3_1.png" id="_" mimetype="image/png" height="auto" width="auto"/>
702
- </figure>
703
- <figure id="_">
704
- <name>Intermediate stages: Some fully gelatinized kernels are visible</name>
705
- <image src="spec/examples/rice_images/rice_image3_2.png" id="_" mimetype="image/png" height="auto" width="auto"/>
706
- </figure>
707
- <figure id="_">
708
- <name>Final stages: All kernels are fully gelatinized</name>
709
- <image src="spec/examples/rice_images/rice_image3_3.png" id="_" mimetype="image/png" height="auto" width="auto"/>
710
- </figure></figure>
711
- </sections>
712
- </standard-document>
749
+ output = <<~OUTPUT
750
+ #{BLANK_HDR}
751
+ <sections>
752
+ <figure id="figureC-2"><name>Stages of gelatinization</name><figure id="_">
753
+ <name>Initial stages: No grains are fully gelatinized (ungelatinized starch granules are visible inside the kernels)</name>
754
+ <image src="spec/examples/rice_images/rice_image3_1.png" id="_" mimetype="image/png" height="auto" width="auto"/>
755
+ </figure>
756
+ <figure id="_">
757
+ <name>Intermediate stages: Some fully gelatinized kernels are visible</name>
758
+ <image src="spec/examples/rice_images/rice_image3_2.png" id="_" mimetype="image/png" height="auto" width="auto"/>
759
+ </figure>
760
+ <figure id="_">
761
+ <name>Final stages: All kernels are fully gelatinized</name>
762
+ <image src="spec/examples/rice_images/rice_image3_3.png" id="_" mimetype="image/png" height="auto" width="auto"/>
763
+ </figure></figure>
764
+ </sections>
765
+ </standard-document>
713
766
  OUTPUT
767
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
768
+ .to be_equivalent_to xmlpp(output)
714
769
  end
715
770
 
716
- it "processes figures within examples" do
717
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
771
+ it "processes figures within examples" do
772
+ input = <<~INPUT
718
773
  #{ASCIIDOC_BLANK_HDR}
719
774
  [[figureC-2]]
720
775
  .Stages of gelatinization
@@ -731,29 +786,31 @@ RSpec.describe Asciidoctor::Standoc do
731
786
  image::spec/examples/rice_images/rice_image3_3.png[]
732
787
  ====
733
788
  INPUT
734
- #{BLANK_HDR}
735
- <sections>
736
- <example id="figureC-2"><name>Stages of gelatinization</name><figure id="_">
737
- <name>Initial stages: No grains are fully gelatinized (ungelatinized starch granules are visible inside the kernels)</name>
738
- <image src="spec/examples/rice_images/rice_image3_1.png" id="_" mimetype="image/png" height="auto" width="auto"/>
739
- </figure>
740
- <p id="_">Text</p>
741
- <figure id="_">
742
- <name>Intermediate stages: Some fully gelatinized kernels are visible</name>
743
- <image src="spec/examples/rice_images/rice_image3_2.png" id="_" mimetype="image/png" height="auto" width="auto"/>
744
- </figure>
745
- <figure id="_">
746
- <name>Final stages: All kernels are fully gelatinized</name>
747
- <image src="spec/examples/rice_images/rice_image3_3.png" id="_" mimetype="image/png" height="auto" width="auto"/>
748
- </figure></example>
749
- </sections>
750
- </standard-document>
789
+ output = <<~OUTPUT
790
+ #{BLANK_HDR}
791
+ <sections>
792
+ <example id="figureC-2"><name>Stages of gelatinization</name><figure id="_">
793
+ <name>Initial stages: No grains are fully gelatinized (ungelatinized starch granules are visible inside the kernels)</name>
794
+ <image src="spec/examples/rice_images/rice_image3_1.png" id="_" mimetype="image/png" height="auto" width="auto"/>
795
+ </figure>
796
+ <p id="_">Text</p>
797
+ <figure id="_">
798
+ <name>Intermediate stages: Some fully gelatinized kernels are visible</name>
799
+ <image src="spec/examples/rice_images/rice_image3_2.png" id="_" mimetype="image/png" height="auto" width="auto"/>
800
+ </figure>
801
+ <figure id="_">
802
+ <name>Final stages: All kernels are fully gelatinized</name>
803
+ <image src="spec/examples/rice_images/rice_image3_3.png" id="_" mimetype="image/png" height="auto" width="auto"/>
804
+ </figure></example>
805
+ </sections>
806
+ </standard-document>
751
807
  OUTPUT
808
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
809
+ .to be_equivalent_to xmlpp(output)
752
810
  end
753
811
 
754
-
755
- it "processes images" do
756
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
812
+ it "processes images" do
813
+ input = <<~INPUT
757
814
  #{ASCIIDOC_BLANK_HDR}
758
815
 
759
816
  [[ABC]]
@@ -761,7 +818,8 @@ RSpec.describe Asciidoctor::Standoc do
761
818
  .Split-it-right sample divider
762
819
  image::spec/examples/rice_images/rice_image1.png[alttext]
763
820
 
764
- INPUT
821
+ INPUT
822
+ output = <<~OUTPUT
765
823
  #{BLANK_HDR}
766
824
  <sections>
767
825
  <figure id="ABC" unnumbered="true" number="3">
@@ -770,17 +828,20 @@ RSpec.describe Asciidoctor::Standoc do
770
828
  </figure>
771
829
  </sections>
772
830
  </standard-document>
773
- OUTPUT
774
- end
831
+ OUTPUT
832
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
833
+ .to be_equivalent_to xmlpp(output)
834
+ end
775
835
 
776
- it "processes data URI images" do
777
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
836
+ it "processes data URI images" do
837
+ input = <<~INPUT
778
838
  #{ASCIIDOC_BLANK_HDR}
779
839
  [subsequence=A]
780
840
  .Split-it-right sample divider
781
841
  image::data:image/*;base64,iVBORw0KGgoAAAANSUhEUgAAAM4AAAAjCAYAAADcxTWYAAAAAXNSR0IArs4c6QAAExZJREFUeAHtnQmYVcWVx6t3oGn2xRVwQUEQIiKi0YgGVNxmjBCXQcOHkTiaxIwy6mSMqKhJXJKMcUky7kZjBDUoKsEIqIggLsEFUFFAFGSHpmm2Xub3v30LDuW7bwEUP+ed7/u9OudU3br3VtWpqnvfoykYdN2zbgekEccOgZOhNzSHDTAbJsBfYS5sl2wsLHVF9bXu5x/e4w6oWuBWl1RsVz35g3ZtC7TYvNZ90LSju7Hz+a62oMiV1W3atRe0E85evAN1DOLY38GeQR0a3W3hO3A93AL/CXnJt8A3pgUKt/NOruG40WCDZjn2HPgErIzAmAQ7EqS2vryeb4Fd3gLbEzjncdUjzZVPQz8DOkBX6Ai94G7w0g/lOW/k0/9/LVDvClz9N+i2cw2cPbj3B8z9/x79CHgC1hv/W+gXwCnG1x/9QmNnVNXYRfV1rhF7YukZZBj5U+EhaJahbD77K2wBhUxdQSHPN8Wu8Ivho628+u2aFJfUHt898DLcCV+bh9xct092pZnEjfwU0skzZJ4JekkguRm0EtXIyCQl9TXRC4GlpS1dl7Xz3OrSCldQn3Le6kNdamCJAnkzKJDy8jVoAb3kabNplWtaW+1WljR3JXXqnkiG83lZrKvfPoSHY1vJ/XCiFOQoKIcfyNjVkuuK831zwUONnk59jMwZcYGmpIelK2zzigmc9UVl7qXWh0YrTiGrT4Joa2jlEGvk9V3bAtVFjVyn6kWuz6p33MrSZs70Y9/gyg4O7P0Cu3Ng7zIzl8DRstkivtIppJ/kcNX3mrL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JVoNXBRGtJP75RrbfekmXKHD8S4FUK84s8vU6VNIaCiItw4e2Zs35YeDy0hbuyd378Xsn/tJN6j9KmKGmfHa+BXZeC+QSOHrDMjU+9W9Jw1eT2hPaFUffa4TSH8dI6AeqLyvRS4Fm/OxmCX/dRv/Vh4InL/kW2JUtoH1ctqLRegzotfI/Ew7SqiNpCtqu6dttK/MwrrOOXPRS/nSq/vZwbXaLVS5V58vmWyCnFshlxVHFNZAUNMr3zzbaqqVacVRmuyXFjzu3u678gfkW2JEWyDVwMp3rLgqsAr2h+Kq+dMx0Tfn8fAvs9Bb4P/RCZMfd+bNlAAAAAElFTkSuQmCC[alttext]
782
842
 
783
- INPUT
843
+ INPUT
844
+ output = <<~OUTPUT
784
845
  #{BLANK_HDR}
785
846
  <sections>
786
847
  <figure id="_" subsequence="A">
@@ -789,17 +850,20 @@ RSpec.describe Asciidoctor::Standoc do
789
850
  </figure>
790
851
  </sections>
791
852
  </standard-document>
792
- OUTPUT
793
- end
853
+ OUTPUT
854
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
855
+ .to be_equivalent_to xmlpp(output)
856
+ end
794
857
 
795
- it "accepts attributes on images" do
796
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
858
+ it "accepts attributes on images" do
859
+ input = <<~INPUT
797
860
  #{ASCIIDOC_BLANK_HDR}
798
861
  [height=4,width=3,alt="IMAGE",filename="riceimg1.png",titleattr="TITLE"]
799
862
  .Caption
800
863
  image::spec/examples/rice_images/rice_image1.png[]
801
864
 
802
- INPUT
865
+ INPUT
866
+ output = <<~OUTPUT
803
867
  #{BLANK_HDR}
804
868
  <sections>
805
869
  <figure id="_"><name>Caption</name>
@@ -807,16 +871,19 @@ RSpec.describe Asciidoctor::Standoc do
807
871
  </figure>
808
872
  </sections>
809
873
  </standard-document>
810
- OUTPUT
811
- end
874
+ OUTPUT
875
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
876
+ .to be_equivalent_to xmlpp(output)
877
+ end
812
878
 
813
- it "accepts auto for width and height attributes on images" do
814
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
879
+ it "accepts auto for width and height attributes on images" do
880
+ input = <<~INPUT
815
881
  #{ASCIIDOC_BLANK_HDR}
816
882
  [height=4,width=auto]
817
883
  image::spec/examples/rice_images/rice_image1.png[]
818
884
 
819
- INPUT
885
+ INPUT
886
+ output = <<~OUTPUT
820
887
  #{BLANK_HDR}
821
888
  <sections>
822
889
  <figure id="_">
@@ -824,25 +891,30 @@ RSpec.describe Asciidoctor::Standoc do
824
891
  </figure>
825
892
  </sections>
826
893
  </standard-document>
827
- OUTPUT
828
- end
894
+ OUTPUT
895
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
896
+ .to be_equivalent_to xmlpp(output)
897
+ end
829
898
 
830
- it "processes inline images with width and height attributes on images" do
831
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
899
+ it "processes inline images with width and height attributes on images" do
900
+ input = <<~INPUT
832
901
  #{ASCIIDOC_BLANK_HDR}
833
902
  Hello image:spec/examples/rice_images/rice_image1.png[alt, 4, 3], how are you?
834
903
 
835
- INPUT
904
+ INPUT
905
+ output = <<~OUTPUT
836
906
  #{BLANK_HDR}
837
907
  <sections>
838
908
  <p id="_">Hello <image src="spec/examples/rice_images/rice_image1.png" id="_" mimetype="image/png" height="3" width="4" alt="alt"/>, how are you?</p>
839
909
  </sections>
840
910
  </standard-document>
841
- OUTPUT
842
- end
911
+ OUTPUT
912
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
913
+ .to be_equivalent_to xmlpp(output)
914
+ end
843
915
 
844
- it "processes images as datauri" do
845
- expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to include '<image src="data:image/png;base64'
916
+ it "processes images as datauri" do
917
+ input = <<~INPUT
846
918
  = Document title
847
919
  Author
848
920
  :docfile: test.adoc
@@ -853,25 +925,30 @@ RSpec.describe Asciidoctor::Standoc do
853
925
 
854
926
  .Split-it-right sample divider
855
927
  image::spec/examples/rice_images/rice_image1.png[]
856
- INPUT
857
- end
928
+ INPUT
929
+ expect(strip_guid(Asciidoctor.convert(input, *OPTIONS)))
930
+ .to include '<image src="data:image/png;base64'
931
+ end
858
932
 
859
- it "accepts attributes on paragraphs" do
860
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
933
+ it "accepts attributes on paragraphs" do
934
+ input = <<~INPUT
861
935
  #{ASCIIDOC_BLANK_HDR}
862
936
  [align=right,keep-with-next=true,keep-lines-together=true]
863
937
  This para is right-aligned.
864
- INPUT
938
+ INPUT
939
+ output = <<~OUTPUT
865
940
  #{BLANK_HDR}
866
941
  <sections>
867
942
  <p align="right" id="_" keep-with-next="true" keep-lines-together="true">This para is right-aligned.</p>
868
943
  </sections>
869
944
  </standard-document>
870
- OUTPUT
871
- end
945
+ OUTPUT
946
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
947
+ .to be_equivalent_to xmlpp(output)
948
+ end
872
949
 
873
- it "processes blockquotes" do
874
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
950
+ it "processes blockquotes" do
951
+ input = <<~INPUT
875
952
  #{ASCIIDOC_BLANK_HDR}
876
953
 
877
954
  [[ABC]]
@@ -879,7 +956,8 @@ RSpec.describe Asciidoctor::Standoc do
879
956
  ____
880
957
  Block quotation
881
958
  ____
882
- INPUT
959
+ INPUT
960
+ output = <<~OUTPUT
883
961
  #{BLANK_HDR}
884
962
  <sections>
885
963
  <quote id="ABC" align="right" keep-with-next="true" keep-lines-together="true">
@@ -893,13 +971,15 @@ RSpec.describe Asciidoctor::Standoc do
893
971
  </quote>
894
972
  </sections>
895
973
  </standard-document>
896
- OUTPUT
897
- end
974
+ OUTPUT
975
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
976
+ .to be_equivalent_to xmlpp(output)
977
+ end
898
978
 
899
- it "processes source code" do
900
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
979
+ it "processes source code" do
980
+ input = <<~INPUT
901
981
  #{ASCIIDOC_BLANK_HDR}
902
-
982
+
903
983
  [[ABC]]
904
984
  .Caption
905
985
  [source%unnumbered,ruby,number=3,filename=sourcecode1.rb,keep-with-next=true,keep-lines-together=true]
@@ -909,7 +989,8 @@ RSpec.describe Asciidoctor::Standoc do
909
989
  puts x
910
990
  end
911
991
  --
912
- INPUT
992
+ INPUT
993
+ output = <<~OUTPUT
913
994
  #{BLANK_HDR}
914
995
  <sections>
915
996
  <sourcecode id="ABC" lang="ruby" filename="sourcecode1.rb" unnumbered="true" number="3" keep-with-next="true" keep-lines-together="true">
@@ -919,11 +1000,13 @@ RSpec.describe Asciidoctor::Standoc do
919
1000
  end</sourcecode>
920
1001
  </sections>
921
1002
  </standard-document>
922
- OUTPUT
923
- end
1003
+ OUTPUT
1004
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
1005
+ .to be_equivalent_to xmlpp(output)
1006
+ end
924
1007
 
925
- it "processes callouts" do
926
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
1008
+ it "processes callouts" do
1009
+ input = <<~INPUT
927
1010
  #{ASCIIDOC_BLANK_HDR}
928
1011
  [source,ruby]
929
1012
  --
@@ -934,7 +1017,8 @@ RSpec.describe Asciidoctor::Standoc do
934
1017
  --
935
1018
  <1> This is one callout
936
1019
  <2> This is another callout
937
- INPUT
1020
+ INPUT
1021
+ output = <<~OUTPUT
938
1022
  #{BLANK_HDR}
939
1023
  <sections><sourcecode id="_" lang="ruby">puts "Hello, world." <callout target="_">1</callout>
940
1024
  %w{a b c}.each do |x|
@@ -946,11 +1030,13 @@ RSpec.describe Asciidoctor::Standoc do
946
1030
  </annotation></sourcecode>
947
1031
  </sections>
948
1032
  </standard-document>
949
- OUTPUT
950
- end
1033
+ OUTPUT
1034
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
1035
+ .to be_equivalent_to xmlpp(output)
1036
+ end
951
1037
 
952
- it "processes unmodified term sources" do
953
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
1038
+ it "processes unmodified term sources" do
1039
+ input = <<~INPUT
954
1040
  #{ASCIIDOC_BLANK_HDR}
955
1041
  == Terms and Definitions
956
1042
 
@@ -959,6 +1045,9 @@ RSpec.describe Asciidoctor::Standoc do
959
1045
  [.source]
960
1046
  <<ISO2191,section=1>>
961
1047
 
1048
+ [.source]
1049
+ <<ISO2191,droploc%capital%section=1>>
1050
+
962
1051
  === Term2
963
1052
 
964
1053
  Definition
@@ -971,51 +1060,61 @@ RSpec.describe Asciidoctor::Standoc do
971
1060
 
972
1061
  [.source]
973
1062
  {{IEV:xyz,t1,t2}}
974
- INPUT
975
- #{BLANK_HDR}
976
- <sections>
977
- <terms id="_" obligation="normative">
978
- <title>Terms and definitions</title><p id="_">For the purposes of this document,
979
- the following terms and definitions apply.</p>
980
- <term id="term-term1">
981
- <preferred>Term1</preferred>
982
- <termsource status="identical">
983
- <origin bibitemid="ISO2191" type="inline" citeas="">
984
- <localityStack>
985
- <locality type="section"><referenceFrom>1</referenceFrom></locality>
986
- </localityStack>
987
- </origin>
988
- </termsource>
989
- </term>
990
- <term id='term-term2'>
991
- <preferred>Term2</preferred>
992
- <definition>
993
- <p id='_'>Definition</p>
994
- </definition>
995
- <termsource status='identical'>
996
- <origin citeas=''>
997
- <termref base='IEV' target='xyz'/>
998
- </origin>
999
- </termsource>
1000
- <termsource status='identical'>
1001
- <origin citeas=''>
1002
- <termref base='IEV' target='xyz'>t1</termref>
1003
- </origin>
1004
- </termsource>
1005
- <termsource status='identical'>
1006
- <origin citeas=''>
1007
- <termref base='IEV' target='xyz'>t1</termref>
1008
- </origin>
1009
- </termsource>
1010
- </term>
1011
- </terms>
1012
- </sections>
1013
- </standard-document>
1014
- OUTPUT
1015
- end
1063
+ INPUT
1064
+ output = <<~OUTPUT
1065
+ #{BLANK_HDR}
1066
+ <sections>
1067
+ <terms id="_" obligation="normative">
1068
+ <title>Terms and definitions</title><p id="_">For the purposes of this document,
1069
+ the following terms and definitions apply.</p>
1070
+ <term id="term-term1">
1071
+ <preferred>Term1</preferred>
1072
+ <termsource status="identical">
1073
+ <origin bibitemid="ISO2191" type="inline" citeas="">
1074
+ <localityStack>
1075
+ <locality type="section"><referenceFrom>1</referenceFrom></locality>
1076
+ </localityStack>
1077
+ </origin>
1078
+ </termsource>
1079
+ <termsource status="identical">
1080
+ <origin bibitemid="ISO2191" type="inline" citeas="" case='capital' droploc='true'>
1081
+ <localityStack>
1082
+ <locality type="section"><referenceFrom>1</referenceFrom></locality>
1083
+ </localityStack>
1084
+ </origin>
1085
+ </termsource>
1086
+ </term>
1087
+ <term id='term-term2'>
1088
+ <preferred>Term2</preferred>
1089
+ <definition>
1090
+ <p id='_'>Definition</p>
1091
+ </definition>
1092
+ <termsource status='identical'>
1093
+ <origin citeas=''>
1094
+ <termref base='IEV' target='xyz'/>
1095
+ </origin>
1096
+ </termsource>
1097
+ <termsource status='identical'>
1098
+ <origin citeas=''>
1099
+ <termref base='IEV' target='xyz'>t1</termref>
1100
+ </origin>
1101
+ </termsource>
1102
+ <termsource status='identical'>
1103
+ <origin citeas=''>
1104
+ <termref base='IEV' target='xyz'>t1</termref>
1105
+ </origin>
1106
+ </termsource>
1107
+ </term>
1108
+ </terms>
1109
+ </sections>
1110
+ </standard-document>
1111
+ OUTPUT
1112
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
1113
+ .to be_equivalent_to xmlpp(output)
1114
+ end
1016
1115
 
1017
- it "processes modified term sources" do
1018
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
1116
+ it "processes modified term sources" do
1117
+ input = <<~INPUT
1019
1118
  #{ASCIIDOC_BLANK_HDR}
1020
1119
  == Terms and Definitions
1021
1120
 
@@ -1030,47 +1129,50 @@ RSpec.describe Asciidoctor::Standoc do
1030
1129
 
1031
1130
  [.source]
1032
1131
  {{IEV:xyz}}, with adjustments
1033
- INPUT
1034
- #{BLANK_HDR}
1035
- <sections>
1036
- <terms id="_" obligation="normative">
1037
- <title>Terms and definitions</title>
1038
- <p id="_">For the purposes of this document,
1039
- the following terms and definitions apply.</p>
1040
- <term id="term-term1">
1041
- <preferred>Term1</preferred>
1042
- <termsource status="modified">
1043
- <origin bibitemid="ISO2191" type="inline" citeas="">
1044
- <localityStack>
1045
- <locality type="section"><referenceFrom>1</referenceFrom></locality>
1046
- </localityStack>
1047
- </origin>
1048
- <modification>
1049
- <p id="_">with adjustments</p>
1050
- </modification>
1051
- </termsource>
1052
- </term>
1053
- <term id='term-term2'>
1054
- <preferred>Term2</preferred>
1055
- <definition>
1056
- <p id='_'>Definition</p>
1057
- </definition>
1058
- <termsource status='modified'>
1059
- <origin citeas=''>
1060
- <termref base='IEV' target='xyz'/>
1061
- </origin>
1062
- <modification>
1063
- <p id='_'>with adjustments</p>
1064
- </modification>
1065
- </termsource>
1066
- </term>
1067
- </terms>
1068
- </sections>
1069
- </standard-document>
1070
- OUTPUT
1071
- end
1132
+ INPUT
1133
+ output = <<~OUTPUT
1134
+ #{BLANK_HDR}
1135
+ <sections>
1136
+ <terms id="_" obligation="normative">
1137
+ <title>Terms and definitions</title>
1138
+ <p id="_">For the purposes of this document,
1139
+ the following terms and definitions apply.</p>
1140
+ <term id="term-term1">
1141
+ <preferred>Term1</preferred>
1142
+ <termsource status="modified">
1143
+ <origin bibitemid="ISO2191" type="inline" citeas="">
1144
+ <localityStack>
1145
+ <locality type="section"><referenceFrom>1</referenceFrom></locality>
1146
+ </localityStack>
1147
+ </origin>
1148
+ <modification>
1149
+ <p id="_">with adjustments</p>
1150
+ </modification>
1151
+ </termsource>
1152
+ </term>
1153
+ <term id='term-term2'>
1154
+ <preferred>Term2</preferred>
1155
+ <definition>
1156
+ <p id='_'>Definition</p>
1157
+ </definition>
1158
+ <termsource status='modified'>
1159
+ <origin citeas=''>
1160
+ <termref base='IEV' target='xyz'/>
1161
+ </origin>
1162
+ <modification>
1163
+ <p id='_'>with adjustments</p>
1164
+ </modification>
1165
+ </termsource>
1166
+ </term>
1167
+ </terms>
1168
+ </sections>
1169
+ </standard-document>
1170
+ OUTPUT
1171
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
1172
+ .to be_equivalent_to xmlpp(output)
1173
+ end
1072
1174
 
1073
- it "processes recommendation" do
1175
+ it "processes recommendation" do
1074
1176
  input = <<~"INPUT"
1075
1177
  #{ASCIIDOC_BLANK_HDR}
1076
1178
  [.recommendation,label="/ogc/recommendation/wfs/2",subject="user",inherit="/ss/584/2015/level/1; /ss/584/2015/level/2",options="unnumbered",type=verification,model=ogc]
@@ -1078,24 +1180,25 @@ RSpec.describe Asciidoctor::Standoc do
1078
1180
  I recommend this
1079
1181
  ====
1080
1182
  INPUT
1081
- output = <<~"OUTPUT"
1082
- #{BLANK_HDR}
1083
- <sections>
1084
- <recommendation id="_" unnumbered="true" type="verification" model="ogc">
1085
- <label>/ogc/recommendation/wfs/2</label>
1086
- <subject>user</subject>
1087
- <inherit>/ss/584/2015/level/1</inherit>
1088
- <inherit>/ss/584/2015/level/2</inherit>
1089
- <description><p id="_">I recommend this</p></description>
1090
- </recommendation>
1091
- </sections>
1092
- </standard-document>
1183
+ output = <<~"OUTPUT"
1184
+ #{BLANK_HDR}
1185
+ <sections>
1186
+ <recommendation id="_" unnumbered="true" type="verification" model="ogc">
1187
+ <label>/ogc/recommendation/wfs/2</label>
1188
+ <subject>user</subject>
1189
+ <inherit>/ss/584/2015/level/1</inherit>
1190
+ <inherit>/ss/584/2015/level/2</inherit>
1191
+ <description><p id="_">I recommend this</p></description>
1192
+ </recommendation>
1193
+ </sections>
1194
+ </standard-document>
1093
1195
  OUTPUT
1094
1196
 
1095
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(output)
1197
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
1198
+ .to be_equivalent_to xmlpp(output)
1096
1199
  end
1097
1200
 
1098
- it "processes requirement" do
1201
+ it "processes requirement" do
1099
1202
  input = <<~"INPUT"
1100
1203
  #{ASCIIDOC_BLANK_HDR}
1101
1204
  [[ABC]]
@@ -1105,22 +1208,23 @@ RSpec.describe Asciidoctor::Standoc do
1105
1208
  I recommend this
1106
1209
  ====
1107
1210
  INPUT
1108
- output = <<~"OUTPUT"
1109
- #{BLANK_HDR}
1110
- <sections>
1111
- <requirement id="ABC" subsequence="A" number="3" keep-with-next="true" keep-lines-together="true">
1112
- <title>Title</title>
1113
- <inherit>/ss/584/2015/level/1 &amp; /ss/584/2015/level/2</inherit>
1114
- <description><p id="_">I recommend this</p></description>
1115
- </requirement>
1116
- </sections>
1117
- </standard-document>
1211
+ output = <<~OUTPUT
1212
+ #{BLANK_HDR}
1213
+ <sections>
1214
+ <requirement id="ABC" subsequence="A" number="3" keep-with-next="true" keep-lines-together="true">
1215
+ <title>Title</title>
1216
+ <inherit>/ss/584/2015/level/1 &amp; /ss/584/2015/level/2</inherit>
1217
+ <description><p id="_">I recommend this</p></description>
1218
+ </requirement>
1219
+ </sections>
1220
+ </standard-document>
1118
1221
  OUTPUT
1119
1222
 
1120
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(output)
1223
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
1224
+ .to be_equivalent_to xmlpp(output)
1121
1225
  end
1122
1226
 
1123
- it "processes permission" do
1227
+ it "processes permission" do
1124
1228
  input = <<~"INPUT"
1125
1229
  #{ASCIIDOC_BLANK_HDR}
1126
1230
 
@@ -1130,21 +1234,21 @@ RSpec.describe Asciidoctor::Standoc do
1130
1234
  I recommend this
1131
1235
  ====
1132
1236
  INPUT
1133
- output = <<~"OUTPUT"
1134
- #{BLANK_HDR}
1135
- <sections>
1136
- <permission id="ABC">
1137
- <description><p id="_">I recommend this</p></description>
1138
- </permission>
1139
- </sections>
1140
- </standard-document>
1237
+ output = <<~"OUTPUT"
1238
+ #{BLANK_HDR}
1239
+ <sections>
1240
+ <permission id="ABC">
1241
+ <description><p id="_">I recommend this</p></description>
1242
+ </permission>
1243
+ </sections>
1244
+ </standard-document>
1141
1245
  OUTPUT
1142
1246
 
1143
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(output)
1247
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
1248
+ .to be_equivalent_to xmlpp(output)
1144
1249
  end
1145
1250
 
1146
-
1147
- it "processes nested permissions" do
1251
+ it "processes nested permissions" do
1148
1252
  input = <<~"INPUT"
1149
1253
  #{ASCIIDOC_BLANK_HDR}
1150
1254
  [.permission]
@@ -1161,24 +1265,25 @@ RSpec.describe Asciidoctor::Standoc do
1161
1265
  =====
1162
1266
  ====
1163
1267
  INPUT
1164
- output = <<~"OUTPUT"
1165
- #{BLANK_HDR}
1166
- <sections>
1167
- <permission id="_"><description><p id="_">I permit this</p>
1168
- <example id="_">
1169
- <p id="_">Example 2</p>
1170
- </example></description>
1171
- <permission id="_">
1172
- <description><p id="_">I also permit this</p></description>
1173
- </permission></permission>
1174
- </sections>
1175
- </standard-document>
1268
+ output = <<~"OUTPUT"
1269
+ #{BLANK_HDR}
1270
+ <sections>
1271
+ <permission id="_"><description><p id="_">I permit this</p>
1272
+ <example id="_">
1273
+ <p id="_">Example 2</p>
1274
+ </example></description>
1275
+ <permission id="_">
1276
+ <description><p id="_">I also permit this</p></description>
1277
+ </permission></permission>
1278
+ </sections>
1279
+ </standard-document>
1176
1280
  OUTPUT
1177
1281
 
1178
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(output)
1282
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
1283
+ .to be_equivalent_to xmlpp(output)
1179
1284
  end
1180
1285
 
1181
- it "processes recommendation with internal markup of structure" do
1286
+ it "processes recommendation with internal markup of structure" do
1182
1287
  input = <<~"INPUT"
1183
1288
  #{ASCIIDOC_BLANK_HDR}
1184
1289
 
@@ -1194,7 +1299,7 @@ RSpec.describe Asciidoctor::Standoc do
1194
1299
  |Object |Value
1195
1300
  |Mission | Accomplished
1196
1301
  |===
1197
- --
1302
+ --
1198
1303
 
1199
1304
  As for the measurement targets,
1200
1305
 
@@ -1219,7 +1324,7 @@ RSpec.describe Asciidoctor::Standoc do
1219
1324
  end
1220
1325
  ----
1221
1326
  --
1222
-
1327
+
1223
1328
  [.import%exclude]
1224
1329
  --
1225
1330
  [source,CoreRoot]
@@ -1229,167 +1334,167 @@ RSpec.describe Asciidoctor::Standoc do
1229
1334
  --
1230
1335
  ====
1231
1336
  INPUT
1232
- output = <<~"OUTPUT"
1233
- #{BLANK_HDR}
1234
- <sections>
1235
- <recommendation id="ABC" obligation="permission,recommendation" filename="reqt1.rq"><label>/ogc/recommendation/wfs/2</label><subject>user</subject>
1236
- <classification><tag>control-class</tag><value>Technical</value></classification><classification><tag>priority</tag><value>P0</value></classification><classification><tag>family</tag><value>System &amp; Communications Protection</value></classification><classification><tag>family</tag><value>System and Communications Protocols</value></classification>
1237
- <description><p id="_">I recommend <em>this</em>.</p>
1238
- </description><specification exclude="false" type="tabular" keep-with-next="true" keep-lines-together="true"><p id="_">This is the object of the recommendation:</p><table id="_"> <tbody> <tr> <td valign="top" align="left">Object</td> <td valign="top" align="left">Value</td> </tr> <tr> <td valign="top" align="left">Mission</td> <td valign="top" align="left">Accomplished</td> </tr> </tbody></table></specification><description>
1239
- <p id="_">As for the measurement targets,</p>
1240
- </description><measurement-target exclude="false"><p id="_">The measurement target shall be measured as:</p><formula id="_"> <stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><mfrac>
1241
- <mrow>
1242
- <mi>r</mi>
1243
- </mrow>
1244
- <mrow>
1245
- <mn>1</mn>
1246
- </mrow>
1247
- </mfrac><mo>=</mo><mn>0</mn></math></stem></formula></measurement-target>
1248
- <verification exclude="false"><p id="_">The following code will be run for verification:</p><sourcecode lang="CoreRoot" id="_">CoreRoot(success): HttpResponse
1249
- if (success)
1250
- recommendation(label: success-response)
1251
- end</sourcecode></verification>
1252
- <import exclude="true"> <sourcecode lang="CoreRoot" id="_">success-response()</sourcecode></import></recommendation>
1253
- </sections>
1254
- </standard-document>
1337
+ output = <<~"OUTPUT"
1338
+ #{BLANK_HDR}
1339
+ <sections>
1340
+ <recommendation id="ABC" obligation="permission,recommendation" filename="reqt1.rq"><label>/ogc/recommendation/wfs/2</label><subject>user</subject>
1341
+ <classification><tag>control-class</tag><value>Technical</value></classification><classification><tag>priority</tag><value>P0</value></classification><classification><tag>family</tag><value>System &amp; Communications Protection</value></classification><classification><tag>family</tag><value>System and Communications Protocols</value></classification>
1342
+ <description><p id="_">I recommend <em>this</em>.</p>
1343
+ </description><specification exclude="false" type="tabular" keep-with-next="true" keep-lines-together="true"><p id="_">This is the object of the recommendation:</p><table id="_"> <tbody> <tr> <td valign="top" align="left">Object</td> <td valign="top" align="left">Value</td> </tr> <tr> <td valign="top" align="left">Mission</td> <td valign="top" align="left">Accomplished</td> </tr> </tbody></table></specification><description>
1344
+ <p id="_">As for the measurement targets,</p>
1345
+ </description><measurement-target exclude="false"><p id="_">The measurement target shall be measured as:</p><formula id="_"> <stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><mfrac>
1346
+ <mrow>
1347
+ <mi>r</mi>
1348
+ </mrow>
1349
+ <mrow>
1350
+ <mn>1</mn>
1351
+ </mrow>
1352
+ </mfrac><mo>=</mo><mn>0</mn></math></stem></formula></measurement-target>
1353
+ <verification exclude="false"><p id="_">The following code will be run for verification:</p><sourcecode lang="CoreRoot" id="_">CoreRoot(success): HttpResponse
1354
+ if (success)
1355
+ recommendation(label: success-response)
1356
+ end</sourcecode></verification>
1357
+ <import exclude="true"> <sourcecode lang="CoreRoot" id="_">success-response()</sourcecode></import></recommendation>
1358
+ </sections>
1359
+ </standard-document>
1255
1360
  OUTPUT
1256
1361
 
1257
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(output)
1362
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
1363
+ .to be_equivalent_to xmlpp(output)
1258
1364
  end
1259
1365
 
1260
1366
  it "processes delete change clauses" do
1261
1367
  input = <<~"INPUT"
1262
- #{ASCIIDOC_BLANK_HDR}
1263
- [change="modify",locality="page=27",path="//table[2]",path_end="//table[2]/following-sibling:example[1]",title="Change"]
1264
- ==== Change Clause
1265
- _This table contains information on polygon cells which are not included in ISO 10303-52. Remove table 2 completely and replace with:_
1266
- INPUT
1267
- output = <<~"OUTPUT"
1268
- #{BLANK_HDR}
1269
- <sections>
1270
- <clause id='_' inline-header='false' obligation='normative'>
1271
- <title>Change Clause</title>
1272
- <amend id='_' change='modify' path='//table[2]' path_end='//table[2]/following-sibling:example[1]' title='Change'>
1273
- <description>
1274
- <p id='_'>
1275
- <em>
1276
- This table contains information on polygon cells which are not
1277
- included in ISO 10303-52. Remove table 2 completely and replace
1278
- with:
1279
- </em>
1280
- </p>
1281
- </description>
1282
- </amend>
1283
- </clause>
1284
- </sections>
1285
- </standard-document>
1286
- OUTPUT
1287
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(output)
1288
-
1368
+ #{ASCIIDOC_BLANK_HDR}
1369
+ [change="modify",locality="page=27",path="//table[2]",path_end="//table[2]/following-sibling:example[1]",title="Change"]
1370
+ ==== Change Clause
1371
+ _This table contains information on polygon cells which are not included in ISO 10303-52. Remove table 2 completely and replace with:_
1372
+ INPUT
1373
+ output = <<~"OUTPUT"
1374
+ #{BLANK_HDR}
1375
+ <sections>
1376
+ <clause id='_' inline-header='false' obligation='normative'>
1377
+ <title>Change Clause</title>
1378
+ <amend id='_' change='modify' path='//table[2]' path_end='//table[2]/following-sibling:example[1]' title='Change'>
1379
+ <description>
1380
+ <p id='_'>
1381
+ <em>
1382
+ This table contains information on polygon cells which are not
1383
+ included in ISO 10303-52. Remove table 2 completely and replace
1384
+ with:
1385
+ </em>
1386
+ </p>
1387
+ </description>
1388
+ </amend>
1389
+ </clause>
1390
+ </sections>
1391
+ </standard-document>
1392
+ OUTPUT
1393
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
1394
+ .to be_equivalent_to xmlpp(output)
1289
1395
  end
1290
1396
 
1291
1397
  it "processes modify change clauses" do
1292
1398
  input = <<~"INPUT"
1293
- #{ASCIIDOC_BLANK_HDR}
1294
- [change="modify",locality="page=27",path="//table[2]",path_end="//table[2]/following-sibling:example[1]",title="Change"]
1295
- ==== Change Clause
1399
+ #{ASCIIDOC_BLANK_HDR}
1400
+ [change="modify",locality="page=27",path="//table[2]",path_end="//table[2]/following-sibling:example[1]",title="Change"]
1401
+ ==== Change Clause
1296
1402
 
1297
- autonumber:table[2]
1298
- autonumber:note[7]
1403
+ autonumber:table[2]
1404
+ autonumber:note[7]
1299
1405
 
1300
- _This table contains information on polygon cells which are not included in ISO 10303-52. Remove table 2 completely and replace with:_
1406
+ _This table contains information on polygon cells which are not included in ISO 10303-52. Remove table 2 completely and replace with:_
1301
1407
 
1302
- ____
1303
- .Edges of triangle and quadrilateral cells
1304
- |===
1305
- 2+^.^h| triangle 2+^.^h| quadrilateral
1306
- ^.^| edge ^.^| vertices ^.^| edge ^.^| vertices
1307
- ^.^| 1 ^.^| 1, 2 ^.^| 1 ^.^| 1, 2
1308
- ^.^| 2 ^.^| 2, 3 ^.^| 2 ^.^| 2, 3
1309
- ^.^| 3 ^.^| 3, 1 ^.^| 3 ^.^| 3, 4
1310
- | | ^.^| 4 ^.^| 4, 1
1311
- |===
1408
+ ____
1409
+ .Edges of triangle and quadrilateral cells
1410
+ |===
1411
+ 2+^.^h| triangle 2+^.^h| quadrilateral
1412
+ ^.^| edge ^.^| vertices ^.^| edge ^.^| vertices
1413
+ ^.^| 1 ^.^| 1, 2 ^.^| 1 ^.^| 1, 2
1414
+ ^.^| 2 ^.^| 2, 3 ^.^| 2 ^.^| 2, 3
1415
+ ^.^| 3 ^.^| 3, 1 ^.^| 3 ^.^| 3, 4
1416
+ | | ^.^| 4 ^.^| 4, 1
1417
+ |===
1312
1418
 
1313
- ====
1314
- This is not generalised further.
1315
- ====
1419
+ ====
1420
+ This is not generalised further.
1421
+ ====
1316
1422
 
1317
- ____
1423
+ ____
1318
1424
 
1319
- Any further exceptions can be ignored.
1425
+ Any further exceptions can be ignored.
1320
1426
  INPUT
1321
1427
 
1322
- output = <<~"OUTPUT"
1323
- #{BLANK_HDR}
1324
- <sections>
1325
- <clause id='_' inline-header='false' obligation='normative'>
1326
- <title>Change Clause</title>
1327
- <amend id='_' change='modify' path='//table[2]' path_end='//table[2]/following-sibling:example[1]' title='Change'>
1328
- <autonumber type='table'>2</autonumber>
1329
- <autonumber type='note'>7</autonumber>
1330
- <description>
1331
- <p id='_'>
1332
- <em>
1333
- This table contains information on polygon cells which are not
1334
- included in ISO 10303-52. Remove table 2 completely and replace
1335
- with:
1336
- </em>
1337
- </p>
1338
- </description>
1339
- <newcontent id='_'>
1340
- <table id='_'>
1341
- <name>Edges of triangle and quadrilateral cells</name>
1342
- <tbody>
1343
- <tr>
1344
- <th colspan='2' valign='middle' align='center'>triangle</th>
1345
- <th colspan='2' valign='middle' align='center'>quadrilateral</th>
1346
- </tr>
1347
- <tr>
1348
- <td valign='middle' align='center'>edge</td>
1349
- <td valign='middle' align='center'>vertices</td>
1350
- <td valign='middle' align='center'>edge</td>
1351
- <td valign='middle' align='center'>vertices</td>
1352
- </tr>
1353
- <tr>
1354
- <td valign='middle' align='center'>1</td>
1355
- <td valign='middle' align='center'>1, 2</td>
1356
- <td valign='middle' align='center'>1</td>
1357
- <td valign='middle' align='center'>1, 2</td>
1358
- </tr>
1359
- <tr>
1360
- <td valign='middle' align='center'>2</td>
1361
- <td valign='middle' align='center'>2, 3</td>
1362
- <td valign='middle' align='center'>2</td>
1363
- <td valign='middle' align='center'>2, 3</td>
1364
- </tr>
1365
- <tr>
1366
- <td valign='middle' align='center'>3</td>
1367
- <td valign='middle' align='center'>3, 1</td>
1368
- <td valign='middle' align='center'>3</td>
1369
- <td valign='middle' align='center'>3, 4</td>
1370
- </tr>
1371
- <tr>
1372
- <td valign='top' align='left'/>
1373
- <td valign='top' align='left'/>
1374
- <td valign='middle' align='center'>4</td>
1375
- <td valign='middle' align='center'>4, 1</td>
1376
- </tr>
1377
- </tbody>
1378
- </table>
1379
- <example id='_'>
1380
- <p id='_'>This is not generalised further.</p>
1381
- </example>
1382
- </newcontent>
1383
- <description>
1384
- <p id='_'>Any further exceptions can be ignored.</p>
1385
- </description>
1386
- </amend>
1387
- </clause>
1388
- </sections>
1389
- </standard-document>
1390
- OUTPUT
1391
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(output)
1428
+ output = <<~"OUTPUT"
1429
+ #{BLANK_HDR}
1430
+ <sections>
1431
+ <clause id='_' inline-header='false' obligation='normative'>
1432
+ <title>Change Clause</title>
1433
+ <amend id='_' change='modify' path='//table[2]' path_end='//table[2]/following-sibling:example[1]' title='Change'>
1434
+ <autonumber type='table'>2</autonumber>
1435
+ <autonumber type='note'>7</autonumber>
1436
+ <description>
1437
+ <p id='_'>
1438
+ <em>
1439
+ This table contains information on polygon cells which are not
1440
+ included in ISO 10303-52. Remove table 2 completely and replace
1441
+ with:
1442
+ </em>
1443
+ </p>
1444
+ </description>
1445
+ <newcontent id='_'>
1446
+ <table id='_'>
1447
+ <name>Edges of triangle and quadrilateral cells</name>
1448
+ <tbody>
1449
+ <tr>
1450
+ <th colspan='2' valign='middle' align='center'>triangle</th>
1451
+ <th colspan='2' valign='middle' align='center'>quadrilateral</th>
1452
+ </tr>
1453
+ <tr>
1454
+ <td valign='middle' align='center'>edge</td>
1455
+ <td valign='middle' align='center'>vertices</td>
1456
+ <td valign='middle' align='center'>edge</td>
1457
+ <td valign='middle' align='center'>vertices</td>
1458
+ </tr>
1459
+ <tr>
1460
+ <td valign='middle' align='center'>1</td>
1461
+ <td valign='middle' align='center'>1, 2</td>
1462
+ <td valign='middle' align='center'>1</td>
1463
+ <td valign='middle' align='center'>1, 2</td>
1464
+ </tr>
1465
+ <tr>
1466
+ <td valign='middle' align='center'>2</td>
1467
+ <td valign='middle' align='center'>2, 3</td>
1468
+ <td valign='middle' align='center'>2</td>
1469
+ <td valign='middle' align='center'>2, 3</td>
1470
+ </tr>
1471
+ <tr>
1472
+ <td valign='middle' align='center'>3</td>
1473
+ <td valign='middle' align='center'>3, 1</td>
1474
+ <td valign='middle' align='center'>3</td>
1475
+ <td valign='middle' align='center'>3, 4</td>
1476
+ </tr>
1477
+ <tr>
1478
+ <td valign='top' align='left'/>
1479
+ <td valign='top' align='left'/>
1480
+ <td valign='middle' align='center'>4</td>
1481
+ <td valign='middle' align='center'>4, 1</td>
1482
+ </tr>
1483
+ </tbody>
1484
+ </table>
1485
+ <example id='_'>
1486
+ <p id='_'>This is not generalised further.</p>
1487
+ </example>
1488
+ </newcontent>
1489
+ <description>
1490
+ <p id='_'>Any further exceptions can be ignored.</p>
1491
+ </description>
1492
+ </amend>
1493
+ </clause>
1494
+ </sections>
1495
+ </standard-document>
1496
+ OUTPUT
1497
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
1498
+ .to be_equivalent_to xmlpp(output)
1392
1499
  end
1393
-
1394
-
1395
1500
  end