metanorma-iso 1.5.14 → 1.7.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/rake.yml +17 -0
  3. data/.rubocop.yml +0 -4
  4. data/lib/asciidoctor/iso/base.rb +13 -13
  5. data/lib/asciidoctor/iso/basicdoc.rng +20 -3
  6. data/lib/asciidoctor/iso/cleanup.rb +1 -1
  7. data/lib/asciidoctor/iso/front.rb +5 -5
  8. data/lib/asciidoctor/iso/isodoc.rng +118 -4
  9. data/lib/asciidoctor/iso/isostandard-amd.rng +11 -4
  10. data/lib/asciidoctor/iso/isostandard.rng +22 -10
  11. data/lib/asciidoctor/iso/validate.rb +78 -0
  12. data/lib/asciidoctor/iso/validate_section.rb +12 -9
  13. data/lib/isodoc/iso/html/header.html +12 -12
  14. data/lib/isodoc/iso/html/html_iso_intro.html +1 -1
  15. data/lib/isodoc/iso/html/html_iso_titlepage.html +1 -1
  16. data/lib/isodoc/iso/html/word_iso_intro.html +1 -1
  17. data/lib/isodoc/iso/html/word_iso_titlepage.html +1 -1
  18. data/lib/isodoc/iso/html_convert.rb +2 -2
  19. data/lib/isodoc/iso/i18n-en.yaml +2 -0
  20. data/lib/isodoc/iso/i18n-fr.yaml +1 -1
  21. data/lib/isodoc/iso/i18n-zh-Hans.yaml +1 -1
  22. data/lib/isodoc/iso/iso.amendment.xsl +451 -208
  23. data/lib/isodoc/iso/iso.international-standard.xsl +451 -208
  24. data/lib/isodoc/iso/sections.rb +1 -1
  25. data/lib/isodoc/iso/word_convert.rb +2 -2
  26. data/lib/isodoc/iso/xref.rb +28 -12
  27. data/lib/metanorma/iso/processor.rb +11 -0
  28. data/lib/metanorma/iso/version.rb +1 -1
  29. data/metanorma-iso.gemspec +2 -2
  30. data/spec/asciidoctor-iso/amd_spec.rb +575 -573
  31. data/spec/asciidoctor-iso/base_spec.rb +449 -458
  32. data/spec/asciidoctor-iso/blocks_spec.rb +333 -288
  33. data/spec/asciidoctor-iso/cleanup_spec.rb +814 -699
  34. data/spec/asciidoctor-iso/inline_spec.rb +116 -91
  35. data/spec/asciidoctor-iso/lists_spec.rb +128 -121
  36. data/spec/asciidoctor-iso/refs_spec.rb +308 -250
  37. data/spec/asciidoctor-iso/section_spec.rb +273 -242
  38. data/spec/asciidoctor-iso/table_spec.rb +258 -242
  39. data/spec/asciidoctor-iso/validate_spec.rb +1223 -919
  40. data/spec/isodoc/amd_spec.rb +967 -946
  41. data/spec/isodoc/blocks_spec.rb +530 -507
  42. data/spec/isodoc/i18n_spec.rb +953 -911
  43. data/spec/isodoc/inline_spec.rb +355 -293
  44. data/spec/isodoc/iso_spec.rb +340 -316
  45. data/spec/isodoc/metadata_spec.rb +392 -382
  46. data/spec/isodoc/postproc_spec.rb +834 -656
  47. data/spec/isodoc/ref_spec.rb +374 -331
  48. data/spec/isodoc/section_spec.rb +608 -525
  49. data/spec/isodoc/table_spec.rb +472 -411
  50. data/spec/isodoc/terms_spec.rb +209 -185
  51. data/spec/isodoc/xref_spec.rb +1370 -1236
  52. data/spec/metanorma/processor_spec.rb +28 -26
  53. data/spec/spec_helper.rb +184 -189
  54. metadata +7 -10
  55. data/.rubocop.ribose.yml +0 -66
  56. data/lib/metanorma/iso/fonts_manifest.yaml +0 -6
  57. data/spec/assets/xref_error.adoc +0 -7
@@ -2,7 +2,7 @@ require "spec_helper"
2
2
 
3
3
  RSpec.describe Asciidoctor::ISO do
4
4
  it "processes open blocks" do
5
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
5
+ expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
6
6
  #{ASCIIDOC_BLANK_HDR}
7
7
  --
8
8
  x
@@ -12,16 +12,18 @@ RSpec.describe Asciidoctor::ISO do
12
12
  z
13
13
  --
14
14
  INPUT
15
- #{BLANK_HDR}
16
- <sections><p id="_">x</p>
17
- <p id="_">y</p>
18
- <p id="_">z</p></sections>
19
- </iso-standard>
15
+ #{BLANK_HDR}
16
+ <sections>
17
+ <p id="_">x</p>
18
+ <p id="_">y</p>
19
+ <p id="_">z</p>
20
+ </sections>
21
+ </iso-standard>
20
22
  OUTPUT
21
23
  end
22
24
 
23
25
  it "processes stem blocks" do
24
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
26
+ expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
25
27
  #{ASCIIDOC_BLANK_HDR}
26
28
  [stem]
27
29
  ++++
@@ -34,22 +36,47 @@ RSpec.describe Asciidoctor::ISO do
34
36
  <mml:math><mml:msub xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"> <mml:mrow> <mml:mrow> <mml:mi mathvariant="bold-italic">F</mml:mi> </mml:mrow> </mml:mrow> <mml:mrow> <mml:mrow> <mml:mi mathvariant="bold-italic">&#x0391;</mml:mi> </mml:mrow> </mml:mrow> </mml:msub> </mml:math>
35
37
  ++++
36
38
  INPUT
37
- #{BLANK_HDR}
38
- <sections>
39
- <formula id="_">
40
- <stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>r</mi><mo>=</mo><mn>1</mn><mi>%</mi><mi>r</mi><mo>=</mo><mn>1</mn><mi>%</mi></math></stem>
41
- </formula>
42
-
43
- <formula id="_">
44
- <stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><msub> <mrow> <mrow> <mi mathvariant="bold-italic">F</mi> </mrow> </mrow> <mrow> <mrow> <mi mathvariant="bold-italic">Α</mi> </mrow> </mrow> </msub> </math></stem>
45
- </formula>
46
- </sections>
47
- </iso-standard>
39
+ #{BLANK_HDR}
40
+ <sections>
41
+ <formula id="_">
42
+ <stem type="MathML">
43
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
44
+ <mi>r</mi>
45
+ <mo>=</mo>
46
+ <mn>1</mn>
47
+ <mi>%</mi>
48
+ <mi>r</mi>
49
+ <mo>=</mo>
50
+ <mn>1</mn>
51
+ <mi>%</mi>
52
+ </math>
53
+ </stem>
54
+ </formula>
55
+ <formula id="_">
56
+ <stem type="MathML">
57
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
58
+ <msub>
59
+ <mrow>
60
+ <mrow>
61
+ <mi mathvariant="bold-italic">F</mi>
62
+ </mrow>
63
+ </mrow>
64
+ <mrow>
65
+ <mrow>
66
+ <mi mathvariant="bold-italic">Α</mi>
67
+ </mrow>
68
+ </mrow>
69
+ </msub>
70
+ </math>
71
+ </stem>
72
+ </formula>
73
+ </sections>
74
+ </iso-standard>
48
75
  OUTPUT
49
76
  end
50
77
 
51
- it "ignores review blocks unless document is in draft mode" do
52
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
78
+ it "ignores review blocks unless document is in draft mode" do
79
+ expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
53
80
  #{ASCIIDOC_BLANK_HDR}
54
81
  [[foreword]]
55
82
  .Foreword
@@ -61,16 +88,17 @@ RSpec.describe Asciidoctor::ISO do
61
88
 
62
89
  For further information on the Foreword, see *ISO/IEC Directives, Part 2, 2016, Clause 12.*
63
90
  ****
64
- INPUT
65
- #{BLANK_HDR}
66
- <sections><p id="foreword">Foreword</p>
67
- </sections>
68
- </iso-standard>
69
- OUTPUT
70
- end
91
+ INPUT
92
+ #{BLANK_HDR}
93
+ <sections>
94
+ <p id="foreword">Foreword</p>
95
+ </sections>
96
+ </iso-standard>
97
+ OUTPUT
98
+ end
71
99
 
72
100
  it "processes review blocks if document is in draft mode" do
73
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)).sub(/^.+<sections>/m, "<iso-standard><sections>"))).to be_equivalent_to xmlpp(<<~"OUTPUT")
101
+ output = Asciidoctor.convert(<<~"INPUT", *OPTIONS)
74
102
  = Document title
75
103
  Author
76
104
  :docfile: test.adoc
@@ -89,94 +117,96 @@ RSpec.describe Asciidoctor::ISO do
89
117
 
90
118
  For further information on the Foreword, see *ISO/IEC Directives, Part 2, 2016, Clause 12.*
91
119
  ****
92
- INPUT
93
- <iso-standard><sections>
94
- <p id="foreword">Foreword</p>
95
- <review reviewer="ISO" id="_" date="20170101T00:00:00Z" from="foreword" to="foreword"><p id="_">A Foreword shall appear in each document. The generic text is shown here. It does not contain requirements, recommendations or permissions.</p>
96
- <p id="_">For further information on the Foreword, see <strong>ISO/IEC Directives, Part 2, 2016, Clause 12.</strong></p></review></sections>
97
- </iso-standard>
98
-
120
+ INPUT
121
+ expect(xmlpp(strip_guid(output).sub(/^.+<sections>/m, "<iso-standard><sections>")))
122
+ .to be_equivalent_to xmlpp(<<~"OUTPUT")
123
+ <iso-standard>
124
+ <sections>
125
+ <p id="foreword">Foreword</p>
126
+ <review date="20170101T00:00:00Z" from="foreword" id="_" reviewer="ISO" to="foreword">
127
+ <p id="_">A Foreword shall appear in each document. The generic text is shown here. It does not contain requirements, recommendations or permissions.</p>
128
+ <p id="_">For further information on the Foreword, see#{' '}
129
+ <strong>ISO/IEC Directives, Part 2, 2016, Clause 12.</strong></p>
130
+ </review>
131
+ </sections>
132
+ </iso-standard>
99
133
  OUTPUT
100
134
  end
101
135
 
102
136
  it "processes term notes" do
103
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
137
+ expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
104
138
  #{ASCIIDOC_BLANK_HDR}
105
139
  == Terms and Definitions
106
140
 
107
141
  === Term1
108
142
 
109
143
  NOTE: This is a note
110
- INPUT
111
- #{BLANK_HDR}
112
- <sections>
113
- <terms id="_" obligation="normative">
114
- <title>Terms and definitions</title>
115
- #{TERM_BOILERPLATE}
116
- <term id="term-term1">
117
- <preferred>Term1</preferred>
118
- <termnote id="_">
119
- <p id="_">This is a note</p>
120
- </termnote>
121
- </term>
122
- </terms>
123
- </sections>
124
- </iso-standard>
125
- OUTPUT
144
+ INPUT
145
+ #{BLANK_HDR}
146
+ <sections>
147
+ <terms id="_" obligation="normative">
148
+ <title>Terms and definitions</title>
149
+ #{TERM_BOILERPLATE}#{' '}
150
+ <term id="term-term1">
151
+ <preferred>Term1</preferred>
152
+ <termnote id="_">
153
+ <p id="_">This is a note</p></termnote>
154
+ </term>
155
+ </terms>
156
+ </sections>
157
+ </iso-standard>
158
+ OUTPUT
126
159
  end
127
160
 
128
- it "processes notes" do
129
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
161
+ it "processes notes" do
162
+ expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
130
163
  #{ASCIIDOC_BLANK_HDR}
131
164
  NOTE: This is a note
132
- INPUT
133
- #{BLANK_HDR}
134
- <sections>
135
- <note id="_">
136
- <p id="_">This is a note</p>
137
- </note>
138
- </sections>
139
- </iso-standard>
140
-
141
- OUTPUT
142
- end
165
+ INPUT
166
+ #{BLANK_HDR}
167
+ <sections>
168
+ <note id="_">
169
+ <p id="_">This is a note</p>
170
+ </note>
171
+ </sections>
172
+ </iso-standard>
173
+ OUTPUT
174
+ end
143
175
 
144
- it "processes literals" do
145
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
176
+ it "processes literals" do
177
+ expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
146
178
  #{ASCIIDOC_BLANK_HDR}
147
179
  ....
148
180
  LITERAL
149
181
  ....
150
- INPUT
182
+ INPUT
151
183
  #{BLANK_HDR}
152
- <sections>
153
- <figure id="_">
154
- <pre id="_">LITERAL</pre>
155
- </figure>
156
- </sections>
157
- </iso-standard>
158
- OUTPUT
159
- end
184
+ <sections>
185
+ <figure id="_">
186
+ <pre id="_">LITERAL</pre>
187
+ </figure>
188
+ </sections>
189
+ </iso-standard>
190
+ OUTPUT
191
+ end
160
192
 
161
- it "processes simple admonitions with Asciidoc names" do
162
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
193
+ it "processes simple admonitions with Asciidoc names" do
194
+ expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
163
195
  #{ASCIIDOC_BLANK_HDR}
164
196
  CAUTION: Only use paddy or parboiled rice for the determination of husked rice yield.
165
- INPUT
197
+ INPUT
166
198
  #{BLANK_HDR}
167
- <sections>
168
- <admonition id="_" type="caution">
169
- <p id="_">Only use paddy or parboiled rice for the determination of husked rice yield.</p>
170
- </admonition>
171
- </sections>
172
- </iso-standard>
173
-
174
- OUTPUT
175
- end
176
-
199
+ <sections>
200
+ <admonition id="_" type="caution">
201
+ <p id="_">Only use paddy or parboiled rice for the determination of husked rice yield.</p>
202
+ </admonition>
203
+ </sections>
204
+ </iso-standard>
205
+ OUTPUT
206
+ end
177
207
 
178
- it "processes complex admonitions with non-Asciidoc names" do
179
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
208
+ it "processes complex admonitions with non-Asciidoc names" do
209
+ expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
180
210
  #{ASCIIDOC_BLANK_HDR}
181
211
  [CAUTION,type=Safety Precautions]
182
212
  .Safety Precautions
@@ -187,29 +217,31 @@ RSpec.describe Asciidoctor::ISO do
187
217
  . More than two glasses of orange juice in 24 hours makes them howl in harmony with alarms and sirens.
188
218
  . Celery makes them sad.
189
219
  ====
190
- INPUT
191
- #{BLANK_HDR}
192
- <sections>
193
- <admonition id="_" type="safety precautions"><name>Safety Precautions</name><p id="_">While werewolves are hardy community members, keep in mind the following dietary concerns:</p>
194
- <ol id="_">
195
- <li>
196
- <p id="_">They are allergic to cinnamon.</p>
197
- </li>
198
- <li>
199
- <p id="_">More than two glasses of orange juice in 24 hours makes them howl in harmony with alarms and sirens.</p>
200
- </li>
201
- <li>
202
- <p id="_">Celery makes them sad.</p>
203
- </li>
204
- </ol></admonition>
205
- </sections>
206
- </iso-standard>
207
-
208
- OUTPUT
209
- end
220
+ INPUT
221
+ #{BLANK_HDR}
222
+ <sections>
223
+ <admonition id="_" type="safety precautions">
224
+ <name>Safety Precautions</name>
225
+ <p id="_">While werewolves are hardy community members, keep in mind the following dietary concerns:</p>
226
+ <ol id="_">
227
+ <li>
228
+ <p id="_">They are allergic to cinnamon.</p>
229
+ </li>
230
+ <li>
231
+ <p id="_">More than two glasses of orange juice in 24 hours makes them howl in harmony with alarms and sirens.</p>
232
+ </li>
233
+ <li>
234
+ <p id="_">Celery makes them sad.</p>
235
+ </li>
236
+ </ol>
237
+ </admonition>
238
+ </sections>
239
+ </iso-standard>
240
+ OUTPUT
241
+ end
210
242
 
211
- it "processes term examples" do
212
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
243
+ it "processes term examples" do
244
+ expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
213
245
  #{ASCIIDOC_BLANK_HDR}
214
246
  == Terms and Definitions
215
247
 
@@ -217,27 +249,25 @@ RSpec.describe Asciidoctor::ISO do
217
249
 
218
250
  [example]
219
251
  This is an example
220
- INPUT
252
+ INPUT
221
253
  #{BLANK_HDR}
222
- <sections>
223
- <terms id="_" obligation="normative">
224
- <title>Terms and definitions</title>
225
- #{TERM_BOILERPLATE}
226
- <term id="term-term1">
227
- <preferred>Term1</preferred>
228
- <termexample id="_">
229
- <p id="_">This is an example</p>
230
- </termexample>
231
- </term>
232
- </terms>
233
- </sections>
234
- </iso-standard>
235
-
236
- OUTPUT
237
- end
254
+ <sections>
255
+ <terms id="_" obligation="normative">
256
+ <title>Terms and definitions</title>
257
+ #{TERM_BOILERPLATE}
258
+ <term id="term-term1">
259
+ <preferred>Term1</preferred>
260
+ <termexample id="_">
261
+ <p id="_">This is an example</p></termexample>
262
+ </term>
263
+ </terms>
264
+ </sections>
265
+ </iso-standard>
266
+ OUTPUT
267
+ end
238
268
 
239
- it "processes examples" do
240
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
269
+ it "processes examples" do
270
+ expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
241
271
  #{ASCIIDOC_BLANK_HDR}
242
272
  [example]
243
273
  ====
@@ -245,127 +275,135 @@ RSpec.describe Asciidoctor::ISO do
245
275
 
246
276
  Amen
247
277
  ====
248
- INPUT
278
+ INPUT
249
279
  #{BLANK_HDR}
250
- <sections>
251
- <example id="_"><p id="_">This is an example</p>
252
- <p id="_">Amen</p></example>
253
- </sections>
254
- </iso-standard>
255
- OUTPUT
256
- end
280
+ <sections>
281
+ <example id="_">
282
+ <p id="_">This is an example</p>
283
+ <p id="_">Amen</p>
284
+ </example>
285
+ </sections>
286
+ </iso-standard>
287
+ OUTPUT
288
+ end
257
289
 
258
- it "processes preambles" do
259
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
290
+ it "processes preambles" do
291
+ expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
260
292
  #{ASCIIDOC_BLANK_HDR}
261
293
  This is a preamble
262
294
 
263
295
  == Section 1
264
- INPUT
296
+ INPUT
265
297
  #{BLANK_HDR}
266
- <preface><foreword id="_" obligation="informative">
267
- <title>Foreword</title>
268
- <p id="_">This is a preamble</p>
269
- </foreword></preface><sections>
270
- <clause id="_" inline-header="false" obligation="normative">
271
- <title>Section 1</title>
272
- </clause></sections>
273
- </iso-standard>
274
- OUTPUT
275
- end
298
+ <preface>
299
+ <foreword id="_" obligation="informative">
300
+ <title>Foreword</title>
301
+ <p id="_">This is a preamble</p>
302
+ </foreword>
303
+ </preface>
304
+ <sections>
305
+ <clause id="_" inline-header="false" obligation="normative">
306
+ <title>Section 1</title>
307
+ </clause>
308
+ </sections>
309
+ </iso-standard>
310
+ OUTPUT
311
+ end
276
312
 
277
- it "processes images" do
278
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
313
+ it "processes images" do
314
+ expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
279
315
  #{ASCIIDOC_BLANK_HDR}
280
316
  .Split-it-right sample divider
281
317
  image::spec/examples/rice_images/rice_image1.png[]
282
318
 
283
- INPUT
319
+ INPUT
284
320
  #{BLANK_HDR}
285
- <sections>
286
- <figure id="_">
287
- <name>Split-it-right sample divider</name>
288
- <image src="spec/examples/rice_images/rice_image1.png" id="_" mimetype="image/png" height="auto" width="auto"/>
289
- </figure>
290
- </sections>
291
- </iso-standard>
292
- OUTPUT
293
- end
321
+ <sections>
322
+ <figure id="_">
323
+ <name>Split-it-right sample divider</name>
324
+ <image height="auto" id="_" mimetype="image/png" src="spec/examples/rice_images/rice_image1.png" width="auto"/>
325
+ </figure>
326
+ </sections>
327
+ </iso-standard>
328
+ OUTPUT
329
+ end
294
330
 
295
- it "accepts width and height attributes on images" do
296
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
331
+ it "accepts width and height attributes on images" do
332
+ expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
297
333
  #{ASCIIDOC_BLANK_HDR}
298
334
  [height=4,width=3]
299
335
  image::spec/examples/rice_images/rice_image1.png[]
300
336
 
301
- INPUT
337
+ INPUT
302
338
  #{BLANK_HDR}
303
- <sections>
304
- <figure id="_">
305
- <image src="spec/examples/rice_images/rice_image1.png" id="_" mimetype="image/png" height="4" width="3"/>
306
- </figure>
307
- </sections>
308
- </iso-standard>
309
- OUTPUT
310
- end
339
+ <sections>
340
+ <figure id="_">
341
+ <image height="4" id="_" mimetype="image/png" src="spec/examples/rice_images/rice_image1.png" width="3"/>
342
+ </figure>
343
+ </sections>
344
+ </iso-standard>
345
+ OUTPUT
346
+ end
311
347
 
312
- it "accepts auto for width and height attributes on images" do
313
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
348
+ it "accepts auto for width and height attributes on images" do
349
+ expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
314
350
  #{ASCIIDOC_BLANK_HDR}
315
351
  [height=4,width=auto]
316
352
  image::spec/examples/rice_images/rice_image1.png[]
317
353
 
318
- INPUT
354
+ INPUT
319
355
  #{BLANK_HDR}
320
- <sections>
321
- <figure id="_">
322
- <image src="spec/examples/rice_images/rice_image1.png" id="_" mimetype="image/png" height="4" width="auto"/>
323
- </figure>
324
- </sections>
325
- </iso-standard>
326
- OUTPUT
327
- end
356
+ <sections>
357
+ <figure id="_">
358
+ <image height="4" id="_" mimetype="image/png" src="spec/examples/rice_images/rice_image1.png" width="auto"/>
359
+ </figure>
360
+ </sections>
361
+ </iso-standard>
362
+ OUTPUT
363
+ end
328
364
 
329
- it "accepts alignment attribute on paragraphs" do
330
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
365
+ it "accepts alignment attribute on paragraphs" do
366
+ expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
331
367
  #{ASCIIDOC_BLANK_HDR}
332
368
  [align=right]
333
369
  This para is right-aligned.
334
- INPUT
370
+ INPUT
335
371
  #{BLANK_HDR}
336
- <sections>
337
- <p align="right" id="_">This para is right-aligned.</p>
338
- </sections>
372
+ <sections>
373
+ <p align="right" id="_">This para is right-aligned.</p>
374
+ </sections>
339
375
  </iso-standard>
340
- OUTPUT
341
- end
376
+ OUTPUT
377
+ end
342
378
 
343
- it "processes blockquotes" do
344
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
379
+ it "processes blockquotes" do
380
+ expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
345
381
  #{ASCIIDOC_BLANK_HDR}
346
382
  [quote, ISO, "ISO7301,section 1"]
347
383
  ____
348
384
  Block quotation
349
385
  ____
350
- INPUT
386
+ INPUT
351
387
  #{BLANK_HDR}
352
- <sections>
353
- <quote id="_">
354
- <source type="inline" bibitemid="ISO7301" citeas="">
355
- <localityStack>
356
- <locality type="section"><referenceFrom>1</referenceFrom></locality>
357
- </localityStack>
358
- </source>
359
- <author>ISO</author>
360
- <p id="_">Block quotation</p>
361
- </quote>
362
- </sections>
363
- </iso-standard>
364
- OUTPUT
365
- end
388
+ <sections>
389
+ <quote id="_">
390
+ <source bibitemid="ISO7301" citeas="" type="inline">
391
+ <localityStack>
392
+ <locality type="section">
393
+ <referenceFrom>1</referenceFrom>
394
+ </locality>
395
+ </localityStack>
396
+ </source>
397
+ <author>ISO</author>
398
+ <p id="_">Block quotation</p>
399
+ </quote>
400
+ </sections>
401
+ </iso-standard>
402
+ OUTPUT
403
+ end
366
404
 
367
- it "processes source code" do
368
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
405
+ it "processes source code" do
406
+ expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
369
407
  #{ASCIIDOC_BLANK_HDR}
370
408
  [source,ruby]
371
409
  --
@@ -374,20 +412,22 @@ RSpec.describe Asciidoctor::ISO do
374
412
  puts x
375
413
  end
376
414
  --
377
- INPUT
415
+ INPUT
378
416
  #{BLANK_HDR}
379
- <sections>
380
- <sourcecode lang="ruby" id="_">puts "Hello, world."
381
- %w{a b c}.each do |x|
382
- puts x
383
- end</sourcecode>
384
- </sections>
385
- </iso-standard>
386
- OUTPUT
387
- end
417
+ <sections>
418
+ <sourcecode id="_" lang="ruby">
419
+ puts "Hello, world."
420
+ %w{a b c}.each do |x|
421
+ puts x
422
+ end
423
+ </sourcecode>
424
+ </sections>
425
+ </iso-standard>
426
+ OUTPUT
427
+ end
388
428
 
389
- it "processes callouts" do
390
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
429
+ it "processes callouts" do
430
+ expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
391
431
  #{ASCIIDOC_BLANK_HDR}
392
432
  [source,ruby]
393
433
  --
@@ -398,23 +438,28 @@ RSpec.describe Asciidoctor::ISO do
398
438
  --
399
439
  <1> This is one callout
400
440
  <2> This is another callout
401
- INPUT
441
+ INPUT
402
442
  #{BLANK_HDR}
403
- <sections><sourcecode lang="ruby" id="_">puts "Hello, world." <callout target="_">1</callout>
404
- %w{a b c}.each do |x|
405
- puts x <callout target="_">2</callout>
406
- end<annotation id="_">
407
- <p id="_">This is one callout</p>
408
- </annotation><annotation id="_">
409
- <p id="_">This is another callout</p>
410
- </annotation></sourcecode>
411
- </sections>
412
- </iso-standard>
413
- OUTPUT
414
- end
443
+ <sections>
444
+ <sourcecode id="_" lang="ruby">
445
+ puts "Hello, world." <callout target="_">1</callout>
446
+ %w{a b c}.each do |x|
447
+ puts x <callout target="_">2</callout>
448
+ end
449
+ <annotation id="_">
450
+ <p id="_">This is one callout</p>
451
+ </annotation>
452
+ <annotation id="_">
453
+ <p id="_">This is another callout</p>
454
+ </annotation>
455
+ </sourcecode>
456
+ </sections>
457
+ </iso-standard>
458
+ OUTPUT
459
+ end
415
460
 
416
- it "processes unmodified term sources" do
417
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
461
+ it "processes unmodified term sources" do
462
+ expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
418
463
  #{ASCIIDOC_BLANK_HDR}
419
464
  == Terms and Definitions
420
465
 
@@ -422,30 +467,31 @@ RSpec.describe Asciidoctor::ISO do
422
467
 
423
468
  [.source]
424
469
  <<ISO2191,section=1>>
425
- INPUT
470
+ INPUT
426
471
  #{BLANK_HDR}
427
- <sections>
428
- <terms id="_" obligation="normative">
429
- <title>Terms and definitions</title>
430
- #{TERM_BOILERPLATE}
431
- <term id="term-term1">
432
- <preferred>Term1</preferred>
433
- <termsource status="identical">
434
- <origin bibitemid="ISO2191" type="inline" citeas="">
435
- <localityStack>
436
- <locality type="section"><referenceFrom>1</referenceFrom></locality>
437
- </localityStack>
438
- </origin>
439
- </termsource>
440
- </term>
441
- </terms>
442
- </sections>
443
- </iso-standard>
444
- OUTPUT
445
- end
472
+ <sections>
473
+ <terms id="_" obligation="normative">
474
+ <title>Terms and definitions</title>
475
+ #{TERM_BOILERPLATE}
476
+ <term id="term-term1">
477
+ <preferred>Term1</preferred>
478
+ <termsource status="identical">
479
+ <origin bibitemid="ISO2191" citeas="" type="inline">
480
+ <localityStack>
481
+ <locality type="section">
482
+ <referenceFrom>1</referenceFrom></locality>
483
+ </localityStack>
484
+ </origin>
485
+ </termsource>
486
+ </term>
487
+ </terms>
488
+ </sections>
489
+ </iso-standard>
490
+ OUTPUT
491
+ end
446
492
 
447
- it "processes modified term sources" do
448
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
493
+ it "processes modified term sources" do
494
+ expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
449
495
  #{ASCIIDOC_BLANK_HDR}
450
496
  == Terms and Definitions
451
497
 
@@ -453,30 +499,29 @@ RSpec.describe Asciidoctor::ISO do
453
499
 
454
500
  [.source]
455
501
  <<ISO2191,section=1>>, with adjustments
456
- INPUT
502
+ INPUT
457
503
  #{BLANK_HDR}
458
- <sections>
459
- <terms id="_" obligation="normative">
460
- <title>Terms and definitions</title>
461
- #{TERM_BOILERPLATE}
462
- <term id="term-term1">
463
- <preferred>Term1</preferred>
464
- <termsource status="modified">
465
- <origin bibitemid="ISO2191" type="inline" citeas="">
466
- <localityStack>
467
- <locality type="section"><referenceFrom>1</referenceFrom></locality>
468
- </localityStack>
469
- </origin>
470
- <modification>
471
- <p id="_">with adjustments</p>
472
- </modification>
473
- </termsource>
474
- </term>
475
- </terms>
476
- </sections>
477
- </iso-standard>
478
- OUTPUT
479
- end
480
-
481
-
504
+ <sections>
505
+ <terms id="_" obligation="normative">
506
+ <title>Terms and definitions</title>
507
+ #{TERM_BOILERPLATE}
508
+ <term id="term-term1">
509
+ <preferred>Term1</preferred>
510
+ <termsource status="modified">
511
+ <origin bibitemid="ISO2191" citeas="" type="inline">
512
+ <localityStack>
513
+ <locality type="section">
514
+ <referenceFrom>1</referenceFrom></locality>
515
+ </localityStack>
516
+ </origin>
517
+ <modification>
518
+ <p id="_">with adjustments</p>
519
+ </modification>
520
+ </termsource>
521
+ </term>
522
+ </terms>
523
+ </sections>
524
+ </iso-standard>
525
+ OUTPUT
526
+ end
482
527
  end