metanorma-standoc 1.9.1 → 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 (36) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +0 -2
  3. data/lib/asciidoctor/standoc/blocks.rb +18 -3
  4. data/lib/asciidoctor/standoc/blocks_notes.rb +29 -18
  5. data/lib/asciidoctor/standoc/cleanup.rb +1 -0
  6. data/lib/asciidoctor/standoc/cleanup_block.rb +30 -12
  7. data/lib/asciidoctor/standoc/cleanup_boilerplate.rb +23 -12
  8. data/lib/asciidoctor/standoc/cleanup_ref.rb +3 -2
  9. data/lib/asciidoctor/standoc/converter.rb +7 -2
  10. data/lib/asciidoctor/standoc/datamodel/plantuml_renderer.rb +67 -66
  11. data/lib/asciidoctor/standoc/isodoc.rng +174 -0
  12. data/lib/asciidoctor/standoc/macros.rb +11 -11
  13. data/lib/asciidoctor/standoc/macros_form.rb +63 -0
  14. data/lib/asciidoctor/standoc/ref_sect.rb +20 -17
  15. data/lib/asciidoctor/standoc/section.rb +3 -1
  16. data/lib/asciidoctor/standoc/terms.rb +24 -17
  17. data/lib/asciidoctor/standoc/utils.rb +3 -3
  18. data/lib/asciidoctor/standoc/validate.rb +18 -16
  19. data/lib/metanorma-standoc.rb +0 -1
  20. data/lib/metanorma/standoc/version.rb +1 -1
  21. data/metanorma-standoc.gemspec +1 -1
  22. data/spec/asciidoctor/blocks_spec.rb +829 -734
  23. data/spec/asciidoctor/cleanup_sections_spec.rb +38 -1
  24. data/spec/asciidoctor/isobib_cache_spec.rb +406 -358
  25. data/spec/asciidoctor/macros_spec.rb +537 -441
  26. data/spec/asciidoctor/macros_yaml2text_spec.rb +1 -1
  27. data/spec/asciidoctor/section_spec.rb +367 -297
  28. data/spec/vcr_cassettes/dated_iso_ref_joint_iso_iec.yml +50 -50
  29. data/spec/vcr_cassettes/isobib_get_123.yml +12 -12
  30. data/spec/vcr_cassettes/isobib_get_123_1.yml +24 -24
  31. data/spec/vcr_cassettes/isobib_get_123_1_fr.yml +33 -33
  32. data/spec/vcr_cassettes/isobib_get_123_2001.yml +12 -12
  33. data/spec/vcr_cassettes/isobib_get_124.yml +12 -12
  34. data/spec/vcr_cassettes/rfcbib_get_rfc8341.yml +14 -14
  35. data/spec/vcr_cassettes/separates_iev_citations_by_top_level_clause.yml +46 -46
  36. metadata +5 -4
@@ -34,9 +34,9 @@ module Asciidoctor
34
34
  fragment = doc.fragment("")
35
35
  ::Nokogiri::XML::Builder.with fragment, &block
36
36
  fragment.to_xml(encoding: "US-ASCII", indent: 0).lines.map do |l|
37
- l.gsub(/>\n$/, ">").gsub(/\s*\n$/m, " ").gsub("–", "\u0096").
38
- gsub("—", "\u0097").gsub("–", "\u0096").
39
- gsub("—", "\u0097")
37
+ l.gsub(/>\n$/, ">").gsub(/\s*\n$/m, " ").gsub("–", "\u0096")
38
+ .gsub("—", "\u0097").gsub("–", "\u0096")
39
+ .gsub("—", "\u0097")
40
40
  end
41
41
  end
42
42
 
@@ -7,7 +7,6 @@ require "iev"
7
7
  module Asciidoctor
8
8
  module Standoc
9
9
  module Validate
10
-
11
10
  SOURCELOCALITY = "./termsource/origin//locality[@type = 'clause']/"\
12
11
  "referenceFrom".freeze
13
12
 
@@ -55,13 +54,13 @@ module Asciidoctor
55
54
  clean_abort("Numeric reference in normative references", doc.to_xml)
56
55
  end
57
56
 
58
- def repeat_id_validate1(ids, x)
59
- if ids[x["id"]]
60
- @log.add("Anchors", x, "Anchor #{x['id']} has already been used "\
61
- "at line #{ids[x['id']]}")
57
+ def repeat_id_validate1(ids, elem)
58
+ if ids[elem["id"]]
59
+ @log.add("Anchors", elem, "Anchor #{elem['id']} has already been "\
60
+ "used at line #{ids[elem['id']]}")
62
61
  raise StandardError.new "Error: multiple instances of same ID"
63
62
  else
64
- ids[x["id"]] = x.line
63
+ ids[elem["id"]] = elem.line
65
64
  end
66
65
  ids
67
66
  end
@@ -78,17 +77,9 @@ module Asciidoctor
78
77
  end
79
78
 
80
79
  def schema_validate(doc, schema)
81
- Tempfile.open(["tmp", ".xml"], :encoding => 'UTF-8') do |f|
80
+ Tempfile.open(["tmp", ".xml"], encoding: "UTF-8") do |f|
82
81
  begin
83
- f.write(doc.to_xml)
84
- f.close
85
- errors = Jing.new(schema).validate(f.path)
86
- warn "Syntax Valid!" if errors.none?
87
- errors.each do |e|
88
- @log.add("Metanorma XML Syntax",
89
- "XML Line #{"%06d" % e[:line]}:#{e[:column]}",
90
- e[:message])
91
- end
82
+ schema_validate1(f, doc, schema)
92
83
  rescue Jing::Error => e
93
84
  clean_abort("Jing failed with error: #{e}", doc.to_xml)
94
85
  ensure
@@ -97,6 +88,17 @@ module Asciidoctor
97
88
  end
98
89
  end
99
90
 
91
+ def schema_validate1(file, doc, schema)
92
+ file.write(doc.to_xml)
93
+ file.close
94
+ errors = Jing.new(schema).validate(file.path)
95
+ warn "Syntax Valid!" if errors.none?
96
+ errors.each do |e|
97
+ @log.add("Metanorma XML Syntax",
98
+ "XML Line #{'%06d' % e[:line]}:#{e[:column]}", e[:message])
99
+ end
100
+ end
101
+
100
102
  # RelaxNG cannot cope well with wildcard attributes. So we strip
101
103
  # any attributes from FormattedString instances (which can contain
102
104
  # xs:any markup, and are signalled with @format) before validation.
@@ -1,5 +1,4 @@
1
1
  require "asciidoctor" unless defined? Asciidoctor::Converter
2
- #require_relative "asciidoctor/standoc"
3
2
  require_relative "asciidoctor/standoc/converter"
4
3
  require_relative "metanorma/standoc/version"
5
4
  require "asciidoctor/extensions"
@@ -19,6 +19,6 @@ module Metanorma
19
19
  end
20
20
 
21
21
  module Standoc
22
- VERSION = "1.9.1".freeze
22
+ VERSION = "1.9.2".freeze
23
23
  end
24
24
  end
@@ -28,7 +28,7 @@ Gem::Specification.new do |spec|
28
28
 
29
29
  spec.add_dependency "asciidoctor", "~> 2.0.0"
30
30
  spec.add_dependency "iev", "~> 0.2.1"
31
- spec.add_dependency "isodoc", "~> 1.6.0"
31
+ spec.add_dependency "isodoc", "~> 1.6.2"
32
32
  spec.add_dependency "metanorma-plugin-datastruct"
33
33
  spec.add_dependency "metanorma-plugin-lutaml"
34
34
  spec.add_dependency "ruby-jing"
@@ -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+1WljR3JXXqnki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SIHWeSvm4zU+l1Tj8OXBH9MPCJ3Y9z5y582s0r3zubL0BTVZf35VsgqQUeJUNINOm3BD3GaBe1Br4gua44ijgvL3slTvWM41ed8iBP5hPGp1d5WZ1brzHbblrtHtnrJDeTf/3ZZuOqbZY5U2dezbfAzmiBDVSixxC9sUwZNDpJVoNXBRGtJP75RrbfekmXKHD8S4FUK84s8vU6VNIaCiItw4e2Zs35YeDy0hbuyd378Xsn/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
 
@@ -974,58 +1060,61 @@ RSpec.describe Asciidoctor::Standoc do
974
1060
 
975
1061
  [.source]
976
1062
  {{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
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
1026
1115
 
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")
1116
+ it "processes modified term sources" do
1117
+ input = <<~INPUT
1029
1118
  #{ASCIIDOC_BLANK_HDR}
1030
1119
  == Terms and Definitions
1031
1120
 
@@ -1040,47 +1129,50 @@ RSpec.describe Asciidoctor::Standoc do
1040
1129
 
1041
1130
  [.source]
1042
1131
  {{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
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
1082
1174
 
1083
- it "processes recommendation" do
1175
+ it "processes recommendation" do
1084
1176
  input = <<~"INPUT"
1085
1177
  #{ASCIIDOC_BLANK_HDR}
1086
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]
@@ -1088,24 +1180,25 @@ RSpec.describe Asciidoctor::Standoc do
1088
1180
  I recommend this
1089
1181
  ====
1090
1182
  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>
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>
1103
1195
  OUTPUT
1104
1196
 
1105
- 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)
1106
1199
  end
1107
1200
 
1108
- it "processes requirement" do
1201
+ it "processes requirement" do
1109
1202
  input = <<~"INPUT"
1110
1203
  #{ASCIIDOC_BLANK_HDR}
1111
1204
  [[ABC]]
@@ -1115,22 +1208,23 @@ RSpec.describe Asciidoctor::Standoc do
1115
1208
  I recommend this
1116
1209
  ====
1117
1210
  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>
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>
1128
1221
  OUTPUT
1129
1222
 
1130
- 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)
1131
1225
  end
1132
1226
 
1133
- it "processes permission" do
1227
+ it "processes permission" do
1134
1228
  input = <<~"INPUT"
1135
1229
  #{ASCIIDOC_BLANK_HDR}
1136
1230
 
@@ -1140,21 +1234,21 @@ RSpec.describe Asciidoctor::Standoc do
1140
1234
  I recommend this
1141
1235
  ====
1142
1236
  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>
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>
1151
1245
  OUTPUT
1152
1246
 
1153
- 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)
1154
1249
  end
1155
1250
 
1156
-
1157
- it "processes nested permissions" do
1251
+ it "processes nested permissions" do
1158
1252
  input = <<~"INPUT"
1159
1253
  #{ASCIIDOC_BLANK_HDR}
1160
1254
  [.permission]
@@ -1171,24 +1265,25 @@ RSpec.describe Asciidoctor::Standoc do
1171
1265
  =====
1172
1266
  ====
1173
1267
  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>
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>
1186
1280
  OUTPUT
1187
1281
 
1188
- 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)
1189
1284
  end
1190
1285
 
1191
- it "processes recommendation with internal markup of structure" do
1286
+ it "processes recommendation with internal markup of structure" do
1192
1287
  input = <<~"INPUT"
1193
1288
  #{ASCIIDOC_BLANK_HDR}
1194
1289
 
@@ -1204,7 +1299,7 @@ RSpec.describe Asciidoctor::Standoc do
1204
1299
  |Object |Value
1205
1300
  |Mission | Accomplished
1206
1301
  |===
1207
- --
1302
+ --
1208
1303
 
1209
1304
  As for the measurement targets,
1210
1305
 
@@ -1229,7 +1324,7 @@ RSpec.describe Asciidoctor::Standoc do
1229
1324
  end
1230
1325
  ----
1231
1326
  --
1232
-
1327
+
1233
1328
  [.import%exclude]
1234
1329
  --
1235
1330
  [source,CoreRoot]
@@ -1239,167 +1334,167 @@ RSpec.describe Asciidoctor::Standoc do
1239
1334
  --
1240
1335
  ====
1241
1336
  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>
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>
1265
1360
  OUTPUT
1266
1361
 
1267
- 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)
1268
1364
  end
1269
1365
 
1270
1366
  it "processes delete change clauses" do
1271
1367
  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
-
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)
1299
1395
  end
1300
1396
 
1301
1397
  it "processes modify change clauses" do
1302
1398
  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
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
1306
1402
 
1307
- autonumber:table[2]
1308
- autonumber:note[7]
1403
+ autonumber:table[2]
1404
+ autonumber:note[7]
1309
1405
 
1310
- _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:_
1311
1407
 
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
- |===
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
+ |===
1322
1418
 
1323
- ====
1324
- This is not generalised further.
1325
- ====
1419
+ ====
1420
+ This is not generalised further.
1421
+ ====
1326
1422
 
1327
- ____
1423
+ ____
1328
1424
 
1329
- Any further exceptions can be ignored.
1425
+ Any further exceptions can be ignored.
1330
1426
  INPUT
1331
1427
 
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)
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)
1402
1499
  end
1403
-
1404
-
1405
1500
  end