metanorma-standoc 1.9.0 → 1.10.0

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