metanorma-standoc 2.2.6 → 2.2.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (146) hide show
  1. checksums.yaml +4 -4
  2. data/lib/metanorma/standoc/base.rb +3 -5
  3. data/lib/metanorma/standoc/biblio.rng +5 -0
  4. data/lib/metanorma/standoc/cleanup.rb +17 -17
  5. data/lib/metanorma/standoc/cleanup_amend.rb +2 -2
  6. data/lib/metanorma/standoc/cleanup_biblio.rb +2 -1
  7. data/lib/metanorma/standoc/cleanup_maths.rb +12 -4
  8. data/lib/metanorma/standoc/cleanup_section.rb +19 -9
  9. data/lib/metanorma/standoc/cleanup_symbols.rb +14 -7
  10. data/lib/metanorma/standoc/cleanup_text.rb +10 -4
  11. data/lib/metanorma/standoc/cleanup_toc.rb +1 -2
  12. data/lib/metanorma/standoc/cleanup_xref.rb +55 -14
  13. data/lib/metanorma/standoc/inline.rb +27 -12
  14. data/lib/metanorma/standoc/isodoc.rng +46 -12
  15. data/lib/metanorma/standoc/ref_utility.rb +1 -0
  16. data/lib/metanorma/standoc/render.rb +10 -1
  17. data/lib/metanorma/standoc/section.rb +10 -3
  18. data/lib/metanorma/standoc/utils.rb +6 -1
  19. data/lib/metanorma/standoc/validate.rb +1 -1
  20. data/lib/metanorma/standoc/version.rb +1 -1
  21. data/metanorma-standoc.gemspec +5 -2
  22. metadata +4 -128
  23. data/.github/workflows/automerge.yml +0 -31
  24. data/.github/workflows/rake.yml +0 -15
  25. data/.github/workflows/release.yml +0 -24
  26. data/Rakefile +0 -8
  27. data/bin/rspec +0 -18
  28. data/spec/assets/a1.adoc +0 -8
  29. data/spec/assets/a2.adoc +0 -10
  30. data/spec/assets/a3.adoc +0 -9
  31. data/spec/assets/a3a.adoc +0 -7
  32. data/spec/assets/a4.adoc +0 -4
  33. data/spec/assets/boilerplate.xml +0 -4
  34. data/spec/assets/codes.yml +0 -695
  35. data/spec/assets/correct.png +0 -0
  36. data/spec/assets/corrupt.png +0 -0
  37. data/spec/assets/header.html +0 -7
  38. data/spec/assets/html-override.css +0 -1
  39. data/spec/assets/html.scss +0 -13
  40. data/spec/assets/htmlcover.html +0 -4
  41. data/spec/assets/htmlintro.html +0 -5
  42. data/spec/assets/i18n.yaml +0 -17
  43. data/spec/assets/iso.adoc +0 -10
  44. data/spec/assets/iso.headless.html +0 -33
  45. data/spec/assets/iso.xml +0 -8
  46. data/spec/assets/iso123.rxl +0 -107
  47. data/spec/assets/rice_image1.png +0 -0
  48. data/spec/assets/scripts.html +0 -3
  49. data/spec/assets/std.css +0 -2
  50. data/spec/assets/word-override.css +0 -1
  51. data/spec/assets/word.scss +0 -13
  52. data/spec/assets/wordcover.html +0 -3
  53. data/spec/assets/wordintro.html +0 -4
  54. data/spec/assets/xref_error.adoc +0 -8
  55. data/spec/examples/103_01_02.html +0 -247
  56. data/spec/examples/codes_table.html +0 -3174
  57. data/spec/examples/datamodel/address_class_profile.adoc +0 -5
  58. data/spec/examples/datamodel/address_class_profile.presentation.xml +0 -14
  59. data/spec/examples/datamodel/address_component_profile.adoc +0 -5
  60. data/spec/examples/datamodel/blank_definition_profile.adoc +0 -5
  61. data/spec/examples/datamodel/common_models_diagram.adoc +0 -5
  62. data/spec/examples/datamodel/models/models/AddressClassProfile.yml +0 -90
  63. data/spec/examples/datamodel/models/models/AddressComponentProfile.yml +0 -63
  64. data/spec/examples/datamodel/models/models/AddressComponentSpecification.yml +0 -15
  65. data/spec/examples/datamodel/models/models/AddressProfile.yml +0 -36
  66. data/spec/examples/datamodel/models/models/AttributeProfile.yml +0 -32
  67. data/spec/examples/datamodel/models/models/InterchangeAddressClassProfile.yml +0 -79
  68. data/spec/examples/datamodel/models/models/Localization copy.yml +0 -23
  69. data/spec/examples/datamodel/models/models/Localization.yml +0 -23
  70. data/spec/examples/datamodel/models/models/ProfileCompliantAddress.yml +0 -36
  71. data/spec/examples/datamodel/models/models/ProfileCompliantAddressComponent.yml +0 -15
  72. data/spec/examples/datamodel/models/models/Signature.yml +0 -20
  73. data/spec/examples/datamodel/models/models/SignatureBlankDefinition.yml +0 -20
  74. data/spec/examples/datamodel/models/models/TextDirectionCode copy.yml +0 -16
  75. data/spec/examples/datamodel/models/models/TextDirectionCode.yml +0 -16
  76. data/spec/examples/datamodel/models/models/Validity.yml +0 -14
  77. data/spec/examples/datamodel/models/models/iso19160-1/Address.yml +0 -22
  78. data/spec/examples/datamodel/models/models/iso19160-1/AddressComponent.yml +0 -2
  79. data/spec/examples/datamodel/models/style.uml.inc +0 -37
  80. data/spec/examples/datamodel/models/views/CommonModels.yml +0 -9
  81. data/spec/examples/datamodel/models/views/TopDown.yml +0 -62
  82. data/spec/examples/datamodel/top_down_diagram.adoc +0 -5
  83. data/spec/examples/english.yaml +0 -69
  84. data/spec/examples/iso_123_.xml +0 -46
  85. data/spec/examples/iso_123_all_parts.xml +0 -46
  86. data/spec/examples/iso_123_no_year_note.xml +0 -47
  87. data/spec/examples/iso_124_.xml +0 -42
  88. data/spec/examples/iso_216_.xml +0 -48
  89. data/spec/examples/iso_iec_12382_.xml +0 -49
  90. data/spec/examples/rice.adoc +0 -715
  91. data/spec/examples/rice.preview.html +0 -1877
  92. data/spec/examples/rice.sh +0 -4
  93. data/spec/examples/rice_images/rice_image1.png +0 -0
  94. data/spec/examples/rice_images/rice_image2.png +0 -0
  95. data/spec/examples/rice_images/rice_image3_1.png +0 -0
  96. data/spec/examples/rice_images/rice_image3_2.png +0 -0
  97. data/spec/examples/rice_images/rice_image3_3.png +0 -0
  98. data/spec/fixtures/action_schemaexpg1.svg +0 -122
  99. data/spec/fixtures/datamodel_description_sections_tree.xml +0 -327
  100. data/spec/fixtures/diagram_definitions.lutaml +0 -22
  101. data/spec/fixtures/macros_datamodel/address_class_profile.xml +0 -149
  102. data/spec/fixtures/macros_datamodel/address_component_profile.xml +0 -71
  103. data/spec/fixtures/macros_datamodel/blank_definition_profile.xml +0 -51
  104. data/spec/fixtures/macros_datamodel/common_models_diagram.xml +0 -7
  105. data/spec/fixtures/macros_datamodel/top_down_diagram.xml +0 -7
  106. data/spec/fixtures/test.exp +0 -121
  107. data/spec/fixtures/test.xmi +0 -9250
  108. data/spec/metanorma/base_spec.rb +0 -1125
  109. data/spec/metanorma/biblio_spec.rb +0 -1012
  110. data/spec/metanorma/blank_spec.rb +0 -37
  111. data/spec/metanorma/blocks_spec.rb +0 -1784
  112. data/spec/metanorma/cleanup_blocks_spec.rb +0 -1099
  113. data/spec/metanorma/cleanup_sections_spec.rb +0 -1849
  114. data/spec/metanorma/cleanup_spec.rb +0 -1931
  115. data/spec/metanorma/cleanup_terms_spec.rb +0 -1543
  116. data/spec/metanorma/datamodel/attributes_table_preprocessor_spec.rb +0 -111
  117. data/spec/metanorma/datamodel/diagram_preprocessor_spec.rb +0 -72
  118. data/spec/metanorma/inline_spec.rb +0 -785
  119. data/spec/metanorma/isobib_cache_spec.rb +0 -742
  120. data/spec/metanorma/lists_spec.rb +0 -232
  121. data/spec/metanorma/macros_concept_spec.rb +0 -1052
  122. data/spec/metanorma/macros_json2text_spec.rb +0 -10
  123. data/spec/metanorma/macros_plantuml_spec.rb +0 -402
  124. data/spec/metanorma/macros_spec.rb +0 -1183
  125. data/spec/metanorma/macros_yaml2text_spec.rb +0 -10
  126. data/spec/metanorma/processor_spec.rb +0 -96
  127. data/spec/metanorma/refs_spec.rb +0 -2807
  128. data/spec/metanorma/reqt_spec.rb +0 -130
  129. data/spec/metanorma/section_spec.rb +0 -1325
  130. data/spec/metanorma/table_spec.rb +0 -474
  131. data/spec/metanorma/validate_spec.rb +0 -886
  132. data/spec/spec_helper.rb +0 -290
  133. data/spec/support/shared_examples/structured_data_2_text_preprocessor.rb +0 -781
  134. data/spec/vcr_cassettes/bsi16341.yml +0 -486
  135. data/spec/vcr_cassettes/dated_iso_ref_joint_iso_iec.yml +0 -611
  136. data/spec/vcr_cassettes/dated_iso_ref_joint_iso_iec1.yml +0 -149
  137. data/spec/vcr_cassettes/hide_refs.yml +0 -587
  138. data/spec/vcr_cassettes/isobib_get_123.yml +0 -149
  139. data/spec/vcr_cassettes/isobib_get_123_1.yml +0 -295
  140. data/spec/vcr_cassettes/isobib_get_123_1_fr.yml +0 -385
  141. data/spec/vcr_cassettes/isobib_get_123_2.yml +0 -295
  142. data/spec/vcr_cassettes/isobib_get_123_2001.yml +0 -149
  143. data/spec/vcr_cassettes/isobib_get_124.yml +0 -149
  144. data/spec/vcr_cassettes/rfcbib_get_rfc8341.yml +0 -367
  145. data/spec/vcr_cassettes/separates_iev_citations_by_top_level_clause.yml +0 -560
  146. data/spec/vcr_cassettes/std-link.yml +0 -149
@@ -1,1784 +0,0 @@
1
- require "spec_helper"
2
- require "open3"
3
-
4
- RSpec.describe Metanorma::Standoc do
5
- it "processes format-specific pass blocks" do
6
- input = <<~INPUT
7
- #{ASCIIDOC_BLANK_HDR}
8
-
9
- [format="rfc,html"]
10
- ++++
11
- <abc>X &gt; Y</abc>
12
- ++++
13
- INPUT
14
- output = <<~OUTPUT
15
- #{BLANK_HDR}
16
- <sections>
17
- <passthrough formats='rfc,html'>&lt;abc&gt;X &gt; Y&lt;/abc&gt;</passthrough>
18
- </sections>
19
- </standard-document>
20
- OUTPUT
21
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
22
- .to be_equivalent_to xmlpp(output)
23
- end
24
-
25
- it "processes Metanorma XML pass blocks" do
26
- input = <<~INPUT
27
- #{ASCIIDOC_BLANK_HDR}
28
-
29
- ++++
30
- <abc>X &gt;
31
- ++++
32
-
33
- ++++
34
- Y</abc>
35
- ++++
36
- INPUT
37
- output = <<~OUTPUT
38
- #{BLANK_HDR}
39
- <sections>
40
- <abc>X &gt; Y</abc>
41
- </sections>
42
- </standard-document>
43
- OUTPUT
44
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
45
- .to be_equivalent_to xmlpp(output)
46
- end
47
-
48
- it "processes open blocks" do
49
- input = <<~INPUT
50
- #{ASCIIDOC_BLANK_HDR}
51
- --
52
- x
53
-
54
- y
55
-
56
- z
57
- --
58
- INPUT
59
- output = <<~OUTPUT
60
- #{BLANK_HDR}
61
- <sections><p id="_">x</p>
62
- <p id="_">y</p>
63
- <p id="_">z</p></sections>
64
- </standard-document>
65
- OUTPUT
66
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
67
- .to be_equivalent_to xmlpp(output)
68
- end
69
-
70
- it "processes stem blocks" do
71
- input = <<~INPUT
72
- #{ASCIIDOC_BLANK_HDR}
73
-
74
- [[ABC]]
75
- [stem%inequality,number=3,keep-with-next=true,keep-lines-together=true,tag=X,multilingual-rendering=common]
76
- ++++
77
- r = 1 %
78
- r = 1 %
79
- ++++
80
-
81
- [stem%unnumbered]
82
- ++++
83
- <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>
84
- ++++
85
-
86
- [latexmath,subsequence=A]
87
- ++++
88
- M =
89
- \\begin{bmatrix}
90
- -\\sin λ_0 & \\cos λ_0 & 0 \\\\
91
- -\\sin φ_0 \\cos λ_0 & -\\sin φ_0 \\sin λ_0 & \\cos φ_0 \\\\
92
- \\cos φ_0 \\cos λ_0 & \\cos φ_0 \\sin λ_0 & \\sin φ_0
93
- \\end{bmatrix}
94
- ++++
95
-
96
- INPUT
97
- output = <<~OUTPUT
98
- #{BLANK_HDR}
99
- <sections>
100
- <formula id='ABC' number='3' keep-with-next='true' keep-lines-together='true' inequality='true' tag='X' multilingual-rendering='common'>
101
- <stem type='MathML'>
102
- <math xmlns='http://www.w3.org/1998/Math/MathML'>
103
- <mi>r</mi>
104
- <mo>=</mo>
105
- <mn>1</mn>
106
- <mo>%</mo>
107
- <mi>r</mi>
108
- <mo>=</mo>
109
- <mn>1</mn>
110
- <mo>%</mo>
111
- </math>
112
- </stem>
113
- </formula>
114
- <formula id='_' unnumbered='true'>
115
- <stem type='MathML'>
116
- <math xmlns='http://www.w3.org/1998/Math/MathML'>
117
- <msub>
118
- <mrow>
119
- <mrow>
120
- <mi mathvariant='bold-italic'>F</mi>
121
- </mrow>
122
- </mrow>
123
- <mrow>
124
- <mrow>
125
- <mi mathvariant='bold-italic'>Α</mi>
126
- </mrow>
127
- </mrow>
128
- </msub>
129
- </math>
130
- </stem>
131
- </formula>
132
- <formula id='_' subsequence='A'>
133
- <stem type='MathML'>
134
- <math xmlns='http://www.w3.org/1998/Math/MathML'>
135
- <mrow>
136
- <mi>M</mi>
137
- <mo>=</mo>
138
- <mo>[</mo>
139
- <mtable>
140
- <mtr>
141
- <mtd>
142
- <mrow>
143
- <mo>−</mo>
144
- <mi>sin</mi>
145
- </mrow>
146
- <msub>
147
- <mi>λ</mi>
148
- <mn>0</mn>
149
- </msub>
150
- </mtd>
151
- <mtd>
152
- <mi>cos</mi>
153
- <msub>
154
- <mi>λ</mi>
155
- <mn>0</mn>
156
- </msub>
157
- </mtd>
158
- <mtd>
159
- <mn>0</mn>
160
- </mtd>
161
- </mtr>
162
- <mtr>
163
- <mtd>
164
- <mrow>
165
- <mo>−</mo>
166
- <mi>sin</mi>
167
- </mrow>
168
- <msub>
169
- <mi>φ</mi>
170
- <mn>0</mn>
171
- </msub>
172
- <mi>cos</mi>
173
- <msub>
174
- <mi>λ</mi>
175
- <mn>0</mn>
176
- </msub>
177
- </mtd>
178
- <mtd>
179
- <mrow>
180
- <mo>−</mo>
181
- <mi>sin</mi>
182
- </mrow>
183
- <msub>
184
- <mi>φ</mi>
185
- <mn>0</mn>
186
- </msub>
187
- <mi>sin</mi>
188
- <msub>
189
- <mi>λ</mi>
190
- <mn>0</mn>
191
- </msub>
192
- </mtd>
193
- <mtd>
194
- <mi>cos</mi>
195
- <msub>
196
- <mi>φ</mi>
197
- <mn>0</mn>
198
- </msub>
199
- </mtd>
200
- </mtr>
201
- <mtr>
202
- <mtd>
203
- <mi>cos</mi>
204
- <msub>
205
- <mi>φ</mi>
206
- <mn>0</mn>
207
- </msub>
208
- <mi>cos</mi>
209
- <msub>
210
- <mi>λ</mi>
211
- <mn>0</mn>
212
- </msub>
213
- </mtd>
214
- <mtd>
215
- <mi>cos</mi>
216
- <msub>
217
- <mi>φ</mi>
218
- <mn>0</mn>
219
- </msub>
220
- <mi>sin</mi>
221
- <msub>
222
- <mi>λ</mi>
223
- <mn>0</mn>
224
- </msub>
225
- </mtd>
226
- <mtd>
227
- <mi>sin</mi>
228
- <msub>
229
- <mi>φ</mi>
230
- <mn>0</mn>
231
- </msub>
232
- </mtd>
233
- </mtr>
234
- </mtable>
235
- <mo>]</mo>
236
- </mrow>
237
- </math>
238
- </stem>
239
- </formula>
240
- </sections>
241
- </standard-document>
242
- OUTPUT
243
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
244
- .to be_equivalent_to xmlpp(output)
245
- end
246
-
247
- it "ignores review blocks unless document is in draft mode" do
248
- input = <<~INPUT
249
- #{ASCIIDOC_BLANK_HDR}
250
- [[foreword]]
251
- .Foreword
252
- Foreword
253
-
254
- [reviewer=ISO,date=20170101,from=foreword,to=foreword]
255
- ****
256
- A Foreword shall appear in each document. The generic text is shown here. It does not contain requirements, recommendations or permissions.
257
-
258
- For further information on the Foreword, see *ISO/IEC Directives, Part 2, 2016, Clause 12.*
259
- ****
260
- INPUT
261
- output = <<~OUTPUT
262
- #{BLANK_HDR}
263
- <sections><p id="foreword">Foreword</p>
264
- </sections>
265
- </standard-document>
266
- OUTPUT
267
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
268
- .to be_equivalent_to xmlpp(output)
269
- end
270
-
271
- it "processes review blocks if document is in draft mode" do
272
- input = <<~INPUT
273
- = Document title
274
- Author
275
- :docfile: test.adoc
276
- :nodoc:
277
- :novalid:
278
- :draft: 1.2
279
-
280
- [[foreword]]
281
- .Foreword
282
- Foreword
283
-
284
- [reviewer=ISO,date=20170101,from=foreword,to=foreword]
285
- ****
286
- A Foreword shall appear in each document. The generic text is shown here. It does not contain requirements, recommendations or permissions.
287
-
288
- For further information on the Foreword, see *ISO/IEC Directives, Part 2, 2016, Clause 12.*
289
- ****
290
- INPUT
291
- output = <<~OUTPUT
292
- <standard-document xmlns="https://www.metanorma.org/ns/standoc" type="semantic" version="#{Metanorma::Standoc::VERSION}">
293
- <bibdata type="standard">
294
- <title language="en" format="text/plain">Document title</title>
295
-
296
-
297
- <version>
298
- <draft>1.2</draft>
299
- </version>
300
- <language>en</language>
301
- <script>Latn</script>
302
- <status><stage>published</stage></status>
303
- <copyright>
304
- <from>#{Date.today.year}</from>
305
- </copyright>
306
- <ext>
307
- <doctype>standard</doctype>
308
- </ext>
309
- </bibdata>
310
- <sections><p id="foreword">Foreword</p>
311
- <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>
312
- <p id="_">For further information on the Foreword, see <strong>ISO/IEC Directives, Part 2, 2016, Clause 12.</strong></p></review></sections>
313
- </standard-document>
314
-
315
- OUTPUT
316
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
317
- .to be_equivalent_to xmlpp(output)
318
- end
319
-
320
- it "processes multiple term definitions" do
321
- input = <<~INPUT
322
- #{ASCIIDOC_BLANK_HDR}
323
- == Terms and Definitions
324
-
325
- === Term1
326
-
327
- [.definition]
328
- --
329
- first definition
330
-
331
- [.source]
332
- <<ISO2191,section=1>>
333
- --
334
-
335
- [.definition]
336
- --
337
- second definition
338
-
339
- [.source]
340
- <<ISO2191,section=2>>
341
- --
342
-
343
- NOTE: This is a note
344
-
345
- [.source]
346
- <<ISO2191,section=3>>
347
-
348
- INPUT
349
- output = <<~OUTPUT
350
- #{BLANK_HDR}
351
- <sections>
352
- <terms id='_' obligation='normative'>
353
- <title>Terms and definitions</title>
354
- <p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
355
- <term id='term-Term1'>
356
- <preferred><expression><name>Term1</name></expression></preferred>
357
- <definition>
358
- <verbal-definition>
359
- <p id='_'>first definition</p>
360
- <termsource status='identical' type="authoritative">
361
- <origin bibitemid='ISO2191' type='inline' citeas=''>
362
- <localityStack>
363
- <locality type='section'>
364
- <referenceFrom>1</referenceFrom>
365
- </locality>
366
- </localityStack>
367
- </origin>
368
- </termsource>
369
- </verbal-definition>
370
- </definition>
371
- <definition>
372
- <verbal-definition>
373
- <p id='_'>second definition</p>
374
- <termsource status='identical' type="authoritative">
375
- <origin bibitemid='ISO2191' type='inline' citeas=''>
376
- <localityStack>
377
- <locality type='section'>
378
- <referenceFrom>2</referenceFrom>
379
- </locality>
380
- </localityStack>
381
- </origin>
382
- </termsource>
383
- </verbal-definition>
384
- </definition>
385
- <termnote id='_'>
386
- <p id='_'>This is a note</p>
387
- </termnote>
388
- <termsource status='identical' type="authoritative">
389
- <origin bibitemid='ISO2191' type='inline' citeas=''>
390
- <localityStack>
391
- <locality type='section'>
392
- <referenceFrom>3</referenceFrom>
393
- </locality>
394
- </localityStack>
395
- </origin>
396
- </termsource>
397
- </term>
398
- </terms>
399
- </sections>
400
- </standard-document>
401
- OUTPUT
402
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
403
- .to be_equivalent_to xmlpp(output)
404
- end
405
-
406
- it "processes term notes" do
407
- input = <<~INPUT
408
- #{ASCIIDOC_BLANK_HDR}
409
- == Terms and Definitions
410
-
411
- === Term1
412
-
413
- NOTE: This is a note
414
-
415
- WARNING: This is not a note
416
-
417
- [NOTE,keep-separate=true,tag=X,multilingual-rendering=common]
418
- ====
419
- XYZ
420
- ====
421
- INPUT
422
- output = <<~OUTPUT
423
- #{BLANK_HDR}
424
- <sections>
425
- <terms id="_" obligation="normative">
426
- <title>Terms and definitions</title>
427
- <p id="_">For the purposes of this document, the following terms and definitions apply.</p>
428
- <term id="term-Term1">
429
- <preferred><expression><name>Term1</name></expression></preferred>
430
- <termnote id="_">
431
- <p id="_">This is a note</p>
432
- </termnote>
433
- <admonition id='_' type='warning'>
434
- <p id='_'>This is not a note</p>
435
- </admonition>
436
- <termnote id='_' tag='X' multilingual-rendering='common'>
437
- <p id='_'>XYZ</p>
438
- </termnote>
439
- </term>
440
- </terms>
441
- </sections>
442
- </standard-document>
443
- OUTPUT
444
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
445
- .to be_equivalent_to xmlpp(output)
446
- end
447
-
448
- it "processes term notes outside of terms sections" do
449
- input = <<~INPUT
450
- #{ASCIIDOC_BLANK_HDR}
451
- == Clause
452
-
453
- [NOTE%termnote]
454
- ====
455
- XYZ
456
- ====
457
- INPUT
458
- output = <<~OUTPUT
459
- #{BLANK_HDR}
460
- <sections>
461
- <clause id='_' inline-header='false' obligation='normative'>
462
- <title>Clause</title>
463
- <termnote id='_'>
464
- <p id='_'>XYZ</p>
465
- </termnote>
466
- </clause>
467
- </sections>
468
- </standard-document>
469
- OUTPUT
470
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
471
- .to be_equivalent_to xmlpp(output)
472
- end
473
-
474
- it "processes term notes as plain notes in nonterm clauses" do
475
- input = <<~INPUT
476
- #{ASCIIDOC_BLANK_HDR}
477
- == Terms and Definitions
478
-
479
- NOTE: This is not a termnote
480
-
481
- ====
482
- This is not a termexample
483
- ====
484
-
485
- [.nonterm]
486
- === Term1
487
-
488
- NOTE: This is a note
489
- INPUT
490
- output = <<~OUTPUT
491
- #{BLANK_HDR}
492
- <sections>
493
- <terms id="_" obligation="normative">
494
- <title>Terms and definitions</title>
495
- <p id="_">No terms and definitions are listed in this document.</p>
496
- <note id='_'>
497
- <p id='_'>This is not a termnote</p>
498
- </note>
499
- <example id='_'>
500
- <p id='_'>This is not a termexample</p>
501
- </example>
502
- <clause id="_" inline-header="false" obligation="normative">
503
- <title>Term1</title>
504
- <note id="_">
505
- <p id="_">This is a note</p>
506
- </note>
507
- </clause>
508
- </terms>
509
- </sections>
510
- </standard-document>
511
- OUTPUT
512
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
513
- .to be_equivalent_to xmlpp(output)
514
- end
515
-
516
- it "processes term notes as plain notes in definitions subclauses of terms & definitions" do
517
- input = <<~INPUT
518
- #{ASCIIDOC_BLANK_HDR}
519
- == Terms and Definitions
520
-
521
- === Term1
522
-
523
- === Symbols
524
-
525
- NOTE: This is a note
526
- INPUT
527
- output = <<~OUTPUT
528
- #{BLANK_HDR}
529
- <sections>
530
- <terms id="_" obligation="normative"><title>Terms, definitions and symbols</title>
531
- <p id="_">For the purposes of this document, the following terms and definitions apply.</p>
532
- <term id="term-Term1">
533
- <preferred><expression><name>Term1</name></expression></preferred>
534
- </term>
535
- <definitions id="_" obligation="normative" type="symbols">
536
- <title>Symbols</title>
537
- <note id="_">
538
- <p id="_">This is a note</p>
539
- </note>
540
- </definitions></terms>
541
- </sections>
542
- </standard-document>
543
- OUTPUT
544
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
545
- .to be_equivalent_to xmlpp(output)
546
- end
547
-
548
- it "processes nested terms" do
549
- input = <<~INPUT
550
- #{ASCIIDOC_BLANK_HDR}
551
- == Terms and Definitions
552
-
553
- [.term]
554
- === Term1
555
-
556
- definition
557
-
558
- NOTE: Note 1
559
-
560
- ==== Term11
561
- definition2
562
-
563
- NOTE: Note 2
564
- INPUT
565
- output = <<~OUTPUT
566
- #{BLANK_HDR}
567
- <sections>
568
- <clause id='_' obligation='normative'>
569
- <title>Terms and definitions</title>
570
- <p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
571
- <terms id='_' obligation='normative'>
572
- <title>Term1</title>
573
- <p id='_'>definition</p>
574
- <note id='_'>
575
- <p id='_'>Note 1</p>
576
- </note>
577
- <term id='term-Term11'>
578
- <preferred>
579
- <expression>
580
- <name>Term11</name>
581
- </expression>
582
- </preferred>
583
- <definition>
584
- <verbal-definition>
585
- <p id='_'>definition2</p>
586
- </verbal-definition>
587
- </definition>
588
- <termnote id='_'>
589
- <p id='_'>Note 2</p>
590
- </termnote>
591
- </term>
592
- </terms>
593
- </clause>
594
- </sections>
595
- </standard-document>
596
- OUTPUT
597
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
598
- .to be_equivalent_to xmlpp(output)
599
- end
600
-
601
- it "processes notes" do
602
- input = <<~INPUT
603
- #{ASCIIDOC_BLANK_HDR}
604
- NOTE: This is a note
605
-
606
- == Clause 1
607
-
608
- [[ABC]]
609
- NOTE: This is a note
610
-
611
- [NOTE,keep-separate=true,number=7,subsequence=A,beforeclauses=true,keep-with-next=true,keep-lines-together=true,type=classified,tag=X,multilingual-rendering=common]
612
- ====
613
- XYZ
614
- ====
615
- INPUT
616
- output = <<~OUTPUT
617
- #{BLANK_HDR}
618
- <preface><foreword id="_" obligation="informative">
619
- <title>Foreword</title>
620
- <note id="_">
621
- <p id="_">This is a note</p>
622
- </note>
623
- </foreword></preface><sections>
624
- <note id='_' number="7" subsequence="A" keep-with-next="true" keep-lines-together="true" type="classified" tag='X' multilingual-rendering='common'>
625
- <p id='_'>XYZ</p>
626
- </note>
627
- <clause id="_" inline-header="false" obligation="normative">
628
- <title>Clause 1</title>
629
- <note id="ABC">
630
- <p id="_">This is a note</p>
631
- </note>
632
- </clause></sections>
633
-
634
- </standard-document>
635
-
636
- OUTPUT
637
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
638
- .to be_equivalent_to xmlpp(output)
639
- end
640
-
641
- it "processes literals" do
642
- input = <<~INPUT
643
- #{ASCIIDOC_BLANK_HDR}
644
-
645
- [[ABC]]
646
- [alt=Literal,keep-with-next=true,keep-lines-together=true,tag=X,multilingual-rendering=common]
647
- ....
648
- <LITERAL>
649
- FIGURATIVE
650
- ....
651
- INPUT
652
- output = <<~OUTPUT
653
- #{BLANK_HDR}
654
- <sections>
655
- <figure id="ABC" keep-with-next="true" keep-lines-together="true" tag='X' multilingual-rendering='common'>
656
- <pre alt="Literal" id="_">&lt;LITERAL&gt;
657
- FIGURATIVE
658
- </pre>
659
- </figure>
660
- </sections>
661
- </standard-document>
662
-
663
- OUTPUT
664
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
665
- .to be_equivalent_to xmlpp(output)
666
- end
667
-
668
- it "processes simple admonitions with Asciidoc names" do
669
- input = <<~INPUT
670
- #{ASCIIDOC_BLANK_HDR}
671
- CAUTION: Only use paddy or parboiled rice for the determination of husked rice yield.
672
- INPUT
673
- output = <<~OUTPUT
674
- #{BLANK_HDR}
675
- <sections>
676
- <admonition id="_" type="caution">
677
- <p id="_">Only use paddy or parboiled rice for the determination of husked rice yield.</p>
678
- </admonition>
679
- </sections>
680
- </standard-document>
681
-
682
- OUTPUT
683
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
684
- .to be_equivalent_to xmlpp(output)
685
- end
686
-
687
- it "processes complex admonitions with non-Asciidoc names" do
688
- input = <<~INPUT
689
- #{ASCIIDOC_BLANK_HDR}
690
-
691
- [[ABC]]
692
- [CAUTION,type=Safety Precautions,keep-with-next="true",keep-lines-together="true",tag=X,multilingual-rendering=common,notag=true]
693
- .Precautions
694
- ====
695
- While werewolves are hardy community members, keep in mind the following dietary concerns:
696
-
697
- . They are allergic to cinnamon.
698
- . More than two glasses of orange juice in 24 hours makes them howl in harmony with alarms and sirens.
699
- . Celery makes them sad.
700
- ====
701
- INPUT
702
- output = <<~OUTPUT
703
- #{BLANK_HDR}
704
- <sections>
705
- <admonition id="ABC" type="safety precautions" keep-with-next="true" keep-lines-together="true" tag='X' multilingual-rendering='common' notag="true" unnumbered="true">
706
- <name>Precautions</name><p id="_">While werewolves are hardy community members, keep in mind the following dietary concerns:</p>
707
- <ol id="_" type="arabic">
708
- <li>
709
- <p id="_">They are allergic to cinnamon.</p>
710
- </li>
711
- <li>
712
- <p id="_">More than two glasses of orange juice in 24 hours makes them howl in harmony with alarms and sirens.</p>
713
- </li>
714
- <li>
715
- <p id="_">Celery makes them sad.</p>
716
- </li>
717
- </ol></admonition>
718
- </sections>
719
- </standard-document>
720
-
721
- OUTPUT
722
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
723
- .to be_equivalent_to xmlpp(output)
724
- end
725
-
726
- it "processes term examples" do
727
- input = <<~INPUT
728
- #{ASCIIDOC_BLANK_HDR}
729
- == Terms and Definitions
730
-
731
- === Term1
732
-
733
- [[ABC]]
734
- [example,tag=X,multilingual-rendering=common]
735
- This is an example
736
- INPUT
737
- output = <<~OUTPUT
738
- #{BLANK_HDR}
739
- <sections>
740
- <terms id="_" obligation="normative">
741
- <title>Terms and definitions</title>
742
- <p id="_">For the purposes of this document, the following terms and definitions apply.</p>
743
- <term id="term-Term1">
744
- <preferred><expression><name>Term1</name></expression></preferred>
745
- <termexample id="ABC" tag='X' multilingual-rendering='common'>
746
- <p id="_">This is an example</p>
747
- </termexample></term>
748
- </terms>
749
- </sections>
750
- </standard-document>
751
- OUTPUT
752
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
753
- .to be_equivalent_to xmlpp(output)
754
- end
755
-
756
- it "processes term examples outside of terms sections" do
757
- input = <<~INPUT
758
- #{ASCIIDOC_BLANK_HDR}
759
- == Clause
760
-
761
- [%termexample]
762
- ====
763
- XYZ
764
- ====
765
- INPUT
766
- output = <<~OUTPUT
767
- #{BLANK_HDR}
768
- <sections>
769
- <clause id='_' inline-header='false' obligation='normative'>
770
- <title>Clause</title>
771
- <termexample id='_'>
772
- <p id='_'>XYZ</p>
773
- </termexample>
774
- </clause>
775
- </sections>
776
- </standard-document>
777
- OUTPUT
778
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
779
- .to be_equivalent_to xmlpp(output)
780
- end
781
-
782
- it "processes term examples as plain examples in nonterm clauses" do
783
- input = <<~INPUT
784
- #{ASCIIDOC_BLANK_HDR}
785
- == Terms and Definitions
786
-
787
- [.nonterm]
788
- === Term1
789
-
790
- [example]
791
- This is an example
792
- INPUT
793
- output = <<~OUTPUT
794
- #{BLANK_HDR}
795
- <sections>
796
- <terms id="_" obligation="normative">
797
- <title>Terms and definitions</title>
798
- <p id="_">No terms and definitions are listed in this document.</p>
799
- <clause id="_" inline-header="false" obligation="normative">
800
- <title>Term1</title>
801
- <example id="_">
802
- <p id="_">This is an example</p>
803
- </example>
804
- </clause>
805
- </terms>
806
- </sections>
807
- </standard-document>
808
- OUTPUT
809
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
810
- .to be_equivalent_to xmlpp(output)
811
- end
812
-
813
- it "processes term examples as plain examples in definitions subclauses of terms & definitions" do
814
- input = <<~INPUT
815
- #{ASCIIDOC_BLANK_HDR}
816
- == Terms and Definitions
817
-
818
- === Term1
819
-
820
- === Symbols
821
-
822
- [example]
823
- This is an example
824
- INPUT
825
- output = <<~OUTPUT
826
- #{BLANK_HDR}
827
- <sections>
828
- <terms id="_" obligation="normative"><title>Terms, definitions and symbols</title>
829
- <p id="_">For the purposes of this document, the following terms and definitions apply.</p><term id="term-Term1">
830
- <preferred><expression><name>Term1</name></expression></preferred>
831
- </term>
832
- <definitions id="_" obligation="normative" type="symbols">
833
- <title>Symbols</title>
834
- <example id="_">
835
- <p id="_">This is an example</p>
836
- </example>
837
- </definitions></terms>
838
- </sections>
839
- </standard-document>
840
- OUTPUT
841
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
842
- .to be_equivalent_to xmlpp(output)
843
- end
844
-
845
- it "processes examples" do
846
- input = <<~INPUT
847
- #{ASCIIDOC_BLANK_HDR}
848
-
849
- [[ABC]]
850
- [example,subsequence=A,keep-with-next=true,keep-lines-together=next,tag=X,multilingual-rendering=common]
851
- .Title
852
- ====
853
- This is an example
854
-
855
- Amen
856
- ====
857
-
858
- [example%unnumbered]
859
- ====
860
- This is another example
861
- ====
862
-
863
- [example,number=3]
864
- ====
865
- This is yet another example
866
- ====
867
- INPUT
868
- output = <<~OUTPUT
869
- #{BLANK_HDR}
870
- <sections>
871
- <example id="ABC" subsequence="A" keep-with-next='true' keep-lines-together='next' tag='X' multilingual-rendering='common'>
872
- <name>Title</name>
873
- <p id="_">This is an example</p>
874
- <p id="_">Amen</p></example>
875
- <example id="_" unnumbered="true"><p id="_">This is another example</p></example>
876
- <example id="_" number="3"><p id="_">This is yet another example</p></example>
877
- </sections>
878
- </standard-document>
879
- OUTPUT
880
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
881
- .to be_equivalent_to xmlpp(output)
882
- end
883
-
884
- it "processes preambles" do
885
- input = <<~INPUT
886
- #{ASCIIDOC_BLANK_HDR}
887
- This is a preamble
888
-
889
- == Section 1
890
- INPUT
891
- output = <<~OUTPUT
892
- #{BLANK_HDR}
893
- <preface><foreword id="_" obligation="informative">
894
- <title>Foreword</title>
895
- <p id="_">This is a preamble</p>
896
- </foreword></preface><sections>
897
- <clause id="_" inline-header="false" obligation="normative">
898
- <title>Section 1</title>
899
- </clause></sections>
900
- </standard-document>
901
- OUTPUT
902
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
903
- .to be_equivalent_to xmlpp(output)
904
- end
905
-
906
- it "processes preambles with titles" do
907
- input = <<~INPUT
908
- #{ASCIIDOC_BLANK_HDR}
909
- .Preamble
910
- This is a preamble
911
-
912
- == Section 1
913
- INPUT
914
- output = <<~OUTPUT
915
- #{BLANK_HDR}
916
- <preface><foreword id="_" obligation="informative">
917
- <title>Foreword</title>
918
- <p id="_">This is a preamble</p>
919
- </foreword></preface><sections>
920
- <clause id="_" inline-header="false" obligation="normative">
921
- <title>Section 1</title>
922
- </clause></sections>
923
- </standard-document>
924
- OUTPUT
925
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
926
- .to be_equivalent_to xmlpp(output)
927
- end
928
-
929
- it "processes subfigures" do
930
- input = <<~INPUT
931
- #{ASCIIDOC_BLANK_HDR}
932
- [[figureC-2]]
933
- .Stages of gelatinization
934
- ====
935
- .Initial stages: No grains are fully gelatinized (ungelatinized starch granules are visible inside the kernels)
936
- image::spec/examples/rice_images/rice_image3_1.png[]
937
-
938
- .Intermediate stages: Some fully gelatinized kernels are visible
939
- image::spec/examples/rice_images/rice_image3_2.png[]
940
-
941
- .Final stages: All kernels are fully gelatinized
942
- image::spec/examples/rice_images/rice_image3_3.png[]
943
-
944
- [%key]
945
- A:: B
946
- ====
947
- INPUT
948
- output = <<~OUTPUT
949
- #{BLANK_HDR}
950
- <sections>
951
- <figure id="figureC-2"><name>Stages of gelatinization</name><figure id="_">
952
- <name>Initial stages: No grains are fully gelatinized (ungelatinized starch granules are visible inside the kernels)</name>
953
- <image src="spec/examples/rice_images/rice_image3_1.png" id="_" mimetype="image/png" height="auto" width="auto"/>
954
- </figure>
955
- <figure id="_">
956
- <name>Intermediate stages: Some fully gelatinized kernels are visible</name>
957
- <image src="spec/examples/rice_images/rice_image3_2.png" id="_" mimetype="image/png" height="auto" width="auto"/>
958
- </figure>
959
- <figure id="_">
960
- <name>Final stages: All kernels are fully gelatinized</name>
961
- <image src="spec/examples/rice_images/rice_image3_3.png" id="_" mimetype="image/png" height="auto" width="auto"/>
962
- </figure>
963
- <dl id='_' key='true'>
964
- <dt>A</dt>
965
- <dd>
966
- <p id='_'>B</p>
967
- </dd>
968
- </dl>
969
- </figure>
970
- </sections>
971
- </standard-document>
972
- OUTPUT
973
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
974
- .to be_equivalent_to xmlpp(output)
975
- end
976
-
977
- it "does not create subfigures if there is only one nested figure" do
978
- input = <<~INPUT
979
- #{ASCIIDOC_BLANK_HDR}
980
- [[figureC-2]]
981
- [.figure]
982
- .Stages of gelatinization
983
- ====
984
- image::spec/examples/rice_images/rice_image3_1.png[]
985
- ====
986
- INPUT
987
- output = <<~OUTPUT
988
- #{BLANK_HDR}
989
- <sections>
990
- <figure id="figureC-2"><name>Stages of gelatinization</name>
991
- <image src="spec/examples/rice_images/rice_image3_1.png" id="_" mimetype="image/png" height="auto" width="auto"/>
992
- </figure>
993
- </sections>
994
- </standard-document>
995
- OUTPUT
996
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
997
- .to be_equivalent_to xmlpp(output)
998
- end
999
-
1000
- it "processes figures within examples" do
1001
- input = <<~INPUT
1002
- #{ASCIIDOC_BLANK_HDR}
1003
- [[figureC-2]]
1004
- .Stages of gelatinization
1005
- ====
1006
- .Initial stages: No grains are fully gelatinized (ungelatinized starch granules are visible inside the kernels)
1007
- image::spec/examples/rice_images/rice_image3_1.png[]
1008
-
1009
- Text
1010
-
1011
- .Intermediate stages: Some fully gelatinized kernels are visible
1012
- image::spec/examples/rice_images/rice_image3_2.png[]
1013
-
1014
- .Final stages: All kernels are fully gelatinized
1015
- image::spec/examples/rice_images/rice_image3_3.png[]
1016
- ====
1017
- INPUT
1018
- output = <<~OUTPUT
1019
- #{BLANK_HDR}
1020
- <sections>
1021
- <example id="figureC-2"><name>Stages of gelatinization</name><figure id="_">
1022
- <name>Initial stages: No grains are fully gelatinized (ungelatinized starch granules are visible inside the kernels)</name>
1023
- <image src="spec/examples/rice_images/rice_image3_1.png" id="_" mimetype="image/png" height="auto" width="auto"/>
1024
- </figure>
1025
- <p id="_">Text</p>
1026
- <figure id="_">
1027
- <name>Intermediate stages: Some fully gelatinized kernels are visible</name>
1028
- <image src="spec/examples/rice_images/rice_image3_2.png" id="_" mimetype="image/png" height="auto" width="auto"/>
1029
- </figure>
1030
- <figure id="_">
1031
- <name>Final stages: All kernels are fully gelatinized</name>
1032
- <image src="spec/examples/rice_images/rice_image3_3.png" id="_" mimetype="image/png" height="auto" width="auto"/>
1033
- </figure></example>
1034
- </sections>
1035
- </standard-document>
1036
- OUTPUT
1037
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
1038
- .to be_equivalent_to xmlpp(output)
1039
- end
1040
-
1041
- it "processes figures marked up as examples" do
1042
- input = <<~INPUT
1043
- #{ASCIIDOC_BLANK_HDR}
1044
- [[figureC-2]]
1045
- [.figure]
1046
- .Stages of gelatinization
1047
- ====
1048
- .Initial stages: No grains are fully gelatinized (ungelatinized starch granules are visible inside the kernels)
1049
- image::spec/examples/rice_images/rice_image3_1.png[]
1050
-
1051
- Text
1052
-
1053
- .Intermediate stages: Some fully gelatinized kernels are visible
1054
- image::spec/examples/rice_images/rice_image3_2.png[]
1055
-
1056
- .Final stages: All kernels are fully gelatinized
1057
- image::spec/examples/rice_images/rice_image3_3.png[]
1058
- ====
1059
- INPUT
1060
- output = <<~OUTPUT
1061
- #{BLANK_HDR}
1062
- <sections>
1063
- <figure id="figureC-2"><name>Stages of gelatinization</name><figure id="_">
1064
- <name>Initial stages: No grains are fully gelatinized (ungelatinized starch granules are visible inside the kernels)</name>
1065
- <image src="spec/examples/rice_images/rice_image3_1.png" id="_" mimetype="image/png" height="auto" width="auto"/>
1066
- </figure>
1067
- <p id="_">Text</p>
1068
- <figure id="_">
1069
- <name>Intermediate stages: Some fully gelatinized kernels are visible</name>
1070
- <image src="spec/examples/rice_images/rice_image3_2.png" id="_" mimetype="image/png" height="auto" width="auto"/>
1071
- </figure>
1072
- <figure id="_">
1073
- <name>Final stages: All kernels are fully gelatinized</name>
1074
- <image src="spec/examples/rice_images/rice_image3_3.png" id="_" mimetype="image/png" height="auto" width="auto"/>
1075
- </figure></figure>
1076
- </sections>
1077
- </standard-document>
1078
- OUTPUT
1079
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
1080
- .to be_equivalent_to xmlpp(output)
1081
- end
1082
-
1083
- it "ignores index terms when processing figures marked up as examples" do
1084
- input = <<~INPUT
1085
- #{ASCIIDOC_BLANK_HDR}
1086
-
1087
- ====
1088
- image::spec/examples/rice_images/rice_image3_1.png[]
1089
- ====
1090
-
1091
- ====
1092
- ((indexterm))
1093
-
1094
- image::spec/examples/rice_images/rice_image3_3.png[]
1095
- ====
1096
-
1097
- ====
1098
- (((indexterm2)))
1099
-
1100
- image::spec/examples/rice_images/rice_image3_2.png[]
1101
- ====
1102
- INPUT
1103
- output = <<~OUTPUT
1104
- #{BLANK_HDR}
1105
- <sections>
1106
- <figure id='_'>
1107
- <image src='spec/examples/rice_images/rice_image3_1.png' id='_' mimetype='image/png' height='auto' width='auto'/>
1108
- </figure>
1109
- <example id='_'>
1110
- <p id='_'>
1111
- indexterm
1112
- <index>
1113
- <primary>indexterm</primary>
1114
- </index>
1115
- </p>
1116
- <figure id='_'>
1117
- <image src='spec/examples/rice_images/rice_image3_3.png' id='_' mimetype='image/png' height='auto' width='auto'/>
1118
- </figure>
1119
- </example>
1120
- <figure id='_'>
1121
- <index>
1122
- <primary>indexterm2</primary>
1123
- </index>
1124
- <image src='spec/examples/rice_images/rice_image3_2.png' id='_' mimetype='image/png' height='auto' width='auto'/>
1125
- </figure>
1126
- </sections>
1127
- </standard-document>
1128
- OUTPUT
1129
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
1130
- .to be_equivalent_to xmlpp(output)
1131
- end
1132
-
1133
- it "processes images" do
1134
- input = <<~INPUT
1135
- #{ASCIIDOC_BLANK_HDR}
1136
-
1137
- [[ABC]]
1138
- [%unnumbered,number=3,class=plate]
1139
- .Split-it-right sample divider
1140
- image::spec/examples/rice_images/rice_image1.png[alttext]
1141
-
1142
- INPUT
1143
- output = <<~OUTPUT
1144
- #{BLANK_HDR}
1145
- <sections>
1146
- <figure id="ABC" unnumbered="true" number="3" class="plate">
1147
- <name>Split-it-right sample divider</name>
1148
- <image src="spec/examples/rice_images/rice_image1.png" id="_" mimetype="image/png" height="auto" width="auto" alt="alttext"/>
1149
- </figure>
1150
- </sections>
1151
- </standard-document>
1152
- OUTPUT
1153
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
1154
- .to be_equivalent_to xmlpp(output)
1155
- end
1156
-
1157
- it "processes data URI images" do
1158
- input = <<~INPUT
1159
- #{ASCIIDOC_BLANK_HDR}
1160
- [subsequence=A]
1161
- .Split-it-right sample divider
1162
- image::data:image/*;base64,iVBORw0KGgoAAAANSUhEUgAAAM4AAAAjCAYAAADcxTWYAAAAAXNSR0IArs4c6QAAExZJREFUeAHtnQmYVcWVx6t3oGn2xRVwQUEQIiKi0YgGVNxmjBCXQcOHkTiaxIwy6mSMqKhJXJKMcUky7kZjBDUoKsEIqIggLsEFUFFAFGSHpmm2Xub3v30LDuW7bwEUP+ed7/u9OudU3br3VtWpqnvfoykYdN2zbgekEccOgZOhNzSHDTAbJsBfYS5sl2wsLHVF9bXu5x/e4w6oWuBWl1RsVz35g3ZtC7TYvNZ90LSju7Hz+a62oMiV1W3atRe0E85evAN1DOLY38GeQR0a3W3hO3A93AL/CXnJt8A3pgUKt/NOruG40WCDZjn2HPgErIzAmAQ7EqS2vryeb4Fd3gLbEzjncdUjzZVPQz8DOkBX6Ai94G7w0g/lOW/k0/9/LVDvClz9N+i2cw2cPbj3B8z9/x79CHgC1hv/W+gXwCnG1x/9QmNnVNXYRfV1rhF7YukZZBj5U+EhaJahbD77K2wBhUxdQSHPN8Wu8Ivho628+u2aFJfUHt898DLcCV+bh9xct092pZnEjfwU0skzZJ4JekkguRm0EtXIyCQl9TXRC4GlpS1dl7Xz3OrSCldQn3Le6kNdamCJAnkzKJDy8jVoAb3kabNplWtaW+1WljR3JXXqnkiG83lZrKvfPoSHY1vJ/XCiFOQoKIcfyNjVkuuK831zwUONnk59jMwZcYGmpIelK2zzigmc9UVl7qXWh0YrTiGrT4Joa2jlEGvk9V3bAtVFjVyn6kWuz6p33MrSZs70Y9/gyg4O7P0Cu3Ng7zIzl8DRstkivtIppJ/kcNX3mrLnous1dkbR9qwtM9UrrXq6N1t0ce02rkzasq0LKqsM7Ly5C1tA/biuqLE7ZckUt9f6Ja6ypKnfeIf9VBVcprb2H8c+vXi6OMjfZWY2gaOHix5wpbnK542ejbrAFPp3dAXdS6Bt20Wg+lNKWe0mV1XcxE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vh4InL/kW2JUtoH1ctqLRegzotfI/Ew7SqiNpCtqu6dttK/MwrrOOXPRS/nSq/vZwbXaLVS5V58vmWyCnFshlxVHFNZAUNMr3zzbaqqVacVRmuyXFjzu3u678gfkW2JEWyDVwMp3rLgqsAr2h+Kq+dMx0Tfn8fAvs9Bb4P/RCZMfd+bNlAAAAAElFTkSuQmCC[alttext]
1163
-
1164
- INPUT
1165
- output = <<~OUTPUT
1166
- #{BLANK_HDR}
1167
- <sections>
1168
- <figure id="_" subsequence="A">
1169
- <name>Split-it-right sample divider</name>
1170
- <image src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAM4AAAAjCAYAAADcxTWYAAAAAXNSR0IArs4c6QAAExZJREFUeAHtnQmYVcWVx6t3oGn2xRVwQUEQIiKi0YgGVNxmjBCXQcOHkTiaxIwy6mSMqKhJXJKMcUky7kZjBDUoKsEIqIggLsEFUFFAFGSHpmm2Xub3v30LDuW7bwEUP+ed7/u9OudU3br3VtWpqnvfoykYdN2zbgekEccOgZOhNzSHDTAbJsBfYS5sl2wsLHVF9bXu5x/e4w6oWuBWl1RsVz35g3ZtC7TYvNZ90LSju7Hz+a62oMiV1W3atRe0E85evAN1DOLY38GeQR0a3W3hO3A93AL/CXnJt8A3pgUKt/NOruG40WCDZjn2HPgErIzAmAQ7EqS2vryeb4Fd3gLbEzjncdUjzZVPQz8DOkBX6Ai94G7w0g/lOW/k0/9/LVDvClz9N+i2cw2cPbj3B8z9/x79CHgC1hv/W+gXwCnG1x/9QmNnVNXYRfV1rhF7YukZZBj5U+EhaJahbD77K2wBhUxdQSHPN8Wu8Ivho628+u2aFJfUHt898DLcCV+bh9xct092pZnEjfwU0skzZJ4JekkguRm0EtXIyCQl9TXRC4GlpS1dl7Xz3OrSCldQn3Le6kNdamCJAnkzKJDy8jVoAb3kabNplWtaW+1WljR3JXXqnkiG83lZrKvfPoSHY1vJ/XCiFOQoKIcfyNjVkuuK831zwUONnk59jMwZcYGmpIelK2zzigmc9UVl7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aBe1Br4gua44ijgvL3slTvWM41ed8iBP5hPGp1d5WZ1brzHbblrtHtnrJDeTf/3ZZuOqbZY5U2dezbfAzmiBDVSixxC9sUwZNDpJVoNXBRGtJP75RrbfekmXKHD8S4FUK84s8vU6VNIaCiItw4e2Zs35YeDy0hbuyd378Xsn/tJN6j9KmKGmfHa+BXZeC+QSOHrDMjU+9W9Jw1eT2hPaFUffa4TSH8dI6AeqLyvRS4Fm/OxmCX/dRv/Vh4InL/kW2JUtoH1ctqLRegzotfI/Ew7SqiNpCtqu6dttK/MwrrOOXPRS/nSq/vZwbXaLVS5V58vmWyCnFshlxVHFNZAUNMr3zzbaqqVacVRmuyXFjzu3u678gfkW2JEWyDVwMp3rLgqsAr2h+Kq+dMx0Tfn8fAvs9Bb4P/RCZMfd+bNlAAAAAElFTkSuQmCC" id="_" mimetype="image/png" height="auto" width="auto" alt="alttext"/>
1171
- </figure>
1172
- </sections>
1173
- </standard-document>
1174
- OUTPUT
1175
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
1176
- .to be_equivalent_to xmlpp(output)
1177
- end
1178
-
1179
- it "accepts attributes on images" do
1180
- input = <<~INPUT
1181
- #{ASCIIDOC_BLANK_HDR}
1182
- [height=4,width=3,alt="IMAGE",filename="riceimg1.png",titleattr="TITLE",tag=X,multilingual-rendering=common]
1183
- .Caption
1184
- image::spec/examples/rice_images/rice_image1.png[]
1185
-
1186
- INPUT
1187
- output = <<~OUTPUT
1188
- #{BLANK_HDR}
1189
- <sections>
1190
- <figure id="_" tag='X' multilingual-rendering='common'><name>Caption</name>
1191
- <image src="spec/examples/rice_images/rice_image1.png" id="_" mimetype="image/png" height="4" width="3" title="TITLE" alt="IMAGE" filename="riceimg1.png"/>
1192
- </figure>
1193
- </sections>
1194
- </standard-document>
1195
- OUTPUT
1196
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
1197
- .to be_equivalent_to xmlpp(output)
1198
- end
1199
-
1200
- it "accepts auto for width and height attributes on images" do
1201
- input = <<~INPUT
1202
- #{ASCIIDOC_BLANK_HDR}
1203
- [height=4,width=auto]
1204
- image::spec/examples/rice_images/rice_image1.png[]
1205
-
1206
- INPUT
1207
- output = <<~OUTPUT
1208
- #{BLANK_HDR}
1209
- <sections>
1210
- <figure id="_">
1211
- <image src="spec/examples/rice_images/rice_image1.png" id="_" mimetype="image/png" height="4" width="auto"/>
1212
- </figure>
1213
- </sections>
1214
- </standard-document>
1215
- OUTPUT
1216
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
1217
- .to be_equivalent_to xmlpp(output)
1218
- end
1219
-
1220
- it "processes inline images with width and height attributes on images" do
1221
- input = <<~INPUT
1222
- #{ASCIIDOC_BLANK_HDR}
1223
- Hello image:spec/examples/rice_images/rice_image1.png[alt, 4, 3], how are you?
1224
-
1225
- INPUT
1226
- output = <<~OUTPUT
1227
- #{BLANK_HDR}
1228
- <sections>
1229
- <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>
1230
- </sections>
1231
- </standard-document>
1232
- OUTPUT
1233
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
1234
- .to be_equivalent_to xmlpp(output)
1235
- end
1236
-
1237
- it "processes images as datauri" do
1238
- input = <<~INPUT
1239
- = Document title
1240
- Author
1241
- :docfile: test.adoc
1242
- :nodoc:
1243
- :novalid:
1244
- :no-isobib:
1245
- :data-uri-image:
1246
-
1247
- .Split-it-right sample divider
1248
- image::spec/examples/rice_images/rice_image1.png[]
1249
- INPUT
1250
- expect(strip_guid(Asciidoctor.convert(input, *OPTIONS)))
1251
- .to include '<image src="data:image/png;base64'
1252
-
1253
- input = <<~INPUT
1254
- = Document title
1255
- Author
1256
- :docfile: test.adoc
1257
- :nodoc:
1258
- :novalid:
1259
- :no-isobib:
1260
- :data-uri-image: true
1261
-
1262
- .Split-it-right sample divider
1263
- image::spec/examples/rice_images/rice_image1.png[]
1264
- INPUT
1265
- expect(strip_guid(Asciidoctor.convert(input, *OPTIONS)))
1266
- .to include '<image src="data:image/png;base64'
1267
-
1268
- input = <<~INPUT
1269
- = Document title
1270
- Author
1271
- :docfile: test.adoc
1272
- :nodoc:
1273
- :novalid:
1274
- :no-isobib:
1275
- :data-uri-image: false
1276
-
1277
- .Split-it-right sample divider
1278
- image::spec/examples/rice_images/rice_image1.png[]
1279
- INPUT
1280
- expect(strip_guid(Asciidoctor.convert(input, *OPTIONS)))
1281
- .not_to include '<image src="data:image/png;base64'
1282
-
1283
- input = <<~INPUT
1284
- = Document title
1285
- Author
1286
- :docfile: test.adoc
1287
- :nodoc:
1288
- :novalid:
1289
- :no-isobib:
1290
-
1291
- .Split-it-right sample divider
1292
- image::spec/examples/rice_images/rice_image1.png[]
1293
- INPUT
1294
- expect(strip_guid(Asciidoctor.convert(input, *OPTIONS)))
1295
- .to include '<image src="data:image/png;base64'
1296
- end
1297
-
1298
- it "accepts attributes on paragraphs" do
1299
- input = <<~INPUT
1300
- #{ASCIIDOC_BLANK_HDR}
1301
- [align=right,keep-with-next=true,keep-lines-together=true,tag=X,multilingual-rendering=common]
1302
- This para is right-aligned.
1303
- INPUT
1304
- output = <<~OUTPUT
1305
- #{BLANK_HDR}
1306
- <sections>
1307
- <p align="right" id="_" keep-with-next="true" keep-lines-together="true" tag='X' multilingual-rendering='common'>This para is right-aligned.</p>
1308
- </sections>
1309
- </standard-document>
1310
- OUTPUT
1311
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
1312
- .to be_equivalent_to xmlpp(output)
1313
- end
1314
-
1315
- it "processes blockquotes" do
1316
- input = <<~INPUT
1317
- #{ASCIIDOC_BLANK_HDR}
1318
-
1319
- [[ABC]]
1320
- [quote, ISO, "ISO7301,section 1",align="right",keep-with-next=true,keep-lines-together=true,tag=X,multilingual-rendering=common]
1321
- ____
1322
- Block quotation
1323
- ____
1324
- INPUT
1325
- output = <<~OUTPUT
1326
- #{BLANK_HDR}
1327
- <sections>
1328
- <quote id="ABC" align="right" keep-with-next="true" keep-lines-together="true" tag='X' multilingual-rendering='common'>
1329
- <source type="inline" bibitemid="ISO7301" citeas="">
1330
- <localityStack>
1331
- <locality type="section"><referenceFrom>1</referenceFrom></locality>
1332
- </localityStack>
1333
- </source>
1334
- <author>ISO</author>
1335
- <p id="_">Block quotation</p>
1336
- </quote>
1337
- </sections>
1338
- </standard-document>
1339
- OUTPUT
1340
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
1341
- .to be_equivalent_to xmlpp(output)
1342
- end
1343
-
1344
- it "processes source code" do
1345
- input = <<~INPUT
1346
- #{ASCIIDOC_BLANK_HDR}
1347
-
1348
- [[ABC]]
1349
- .Caption
1350
- [source%unnumbered,ruby,number=3,filename=sourcecode1.rb,keep-with-next=true,keep-lines-together=true,tag=X,multilingual-rendering=common]
1351
- --
1352
- puts "Hello, world."
1353
- %w{a b c}.each do |x|
1354
- puts x
1355
- end
1356
- --
1357
- INPUT
1358
- output = <<~OUTPUT
1359
- #{BLANK_HDR}
1360
- <sections>
1361
- <sourcecode id="ABC" lang="ruby" filename="sourcecode1.rb" unnumbered="true" number="3" keep-with-next="true" keep-lines-together="true" tag='X' multilingual-rendering='common'>
1362
- <name>Caption</name>puts "Hello, world."
1363
- %w{a b c}.each do |x|
1364
- puts x
1365
- end</sourcecode>
1366
- </sections>
1367
- </standard-document>
1368
- OUTPUT
1369
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
1370
- .to be_equivalent_to xmlpp(output)
1371
- end
1372
-
1373
- it "processes callouts" do
1374
- input = <<~INPUT
1375
- #{ASCIIDOC_BLANK_HDR}
1376
- [source,ruby]
1377
- --
1378
- puts "Hello, world." <1>
1379
- %w{a b c}.each do |x|
1380
- puts x <2>
1381
- end
1382
- --
1383
- <1> This is one callout
1384
- <2> This is another callout
1385
- INPUT
1386
- output = <<~OUTPUT
1387
- #{BLANK_HDR}
1388
- <sections><sourcecode id="_" lang="ruby">puts "Hello, world." <callout target="_">1</callout>
1389
- %w{a b c}.each do |x|
1390
- puts x <callout target="_">2</callout>
1391
- end<annotation id="_">
1392
- <p id="_">This is one callout</p>
1393
- </annotation><annotation id="_">
1394
- <p id="_">This is another callout</p>
1395
- </annotation></sourcecode>
1396
- </sections>
1397
- </standard-document>
1398
- OUTPUT
1399
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
1400
- .to be_equivalent_to xmlpp(output)
1401
- end
1402
-
1403
- it "processes unmodified term sources" do
1404
- input = <<~INPUT
1405
- #{ASCIIDOC_BLANK_HDR}
1406
- == Terms and Definitions
1407
-
1408
- === Term1
1409
-
1410
- Definition 0
1411
-
1412
- [.source]
1413
- <<ISO2191,section=1>>
1414
-
1415
- [.source]
1416
- <<ISO2191,droploc%capital%section=1>>
1417
-
1418
- === Term2
1419
-
1420
- Definition
1421
-
1422
- [.source]
1423
- {{<<IEV:xyz>>}}
1424
-
1425
- [.source]
1426
- {{<<IEV:xyz>>,t1}}
1427
-
1428
- [.source]
1429
- {{<<IEV:xyz>>,t1,t2}}
1430
- INPUT
1431
- output = <<~OUTPUT
1432
- #{BLANK_HDR}
1433
- <sections>
1434
- <terms id="_" obligation="normative">
1435
- <title>Terms and definitions</title><p id="_">For the purposes of this document,
1436
- the following terms and definitions apply.</p>
1437
- <term id="term-Term1">
1438
- <preferred><expression><name>Term1</name></expression></preferred>
1439
- <definition><verbal-definition><p id='_'>Definition 0</p></verbal-definition></definition>
1440
- <termsource status="identical" type="authoritative">
1441
- <origin bibitemid="ISO2191" type="inline" citeas="">
1442
- <localityStack>
1443
- <locality type="section"><referenceFrom>1</referenceFrom></locality>
1444
- </localityStack>
1445
- </origin>
1446
- </termsource>
1447
- <termsource status="identical" type="authoritative">
1448
- <origin bibitemid="ISO2191" type="inline" citeas="" case='capital' droploc='true'>
1449
- <localityStack>
1450
- <locality type="section"><referenceFrom>1</referenceFrom></locality>
1451
- </localityStack>
1452
- </origin>
1453
- </termsource>
1454
- </term>
1455
- <term id='term-Term2'>
1456
- <preferred><expression><name>Term2</name></expression></preferred>
1457
- <definition>
1458
- <verbal-definition>
1459
- <p id='_'>Definition</p>
1460
- </verbal-definition>
1461
- </definition>
1462
- <termsource status='identical' type="authoritative">
1463
- <origin citeas=''>
1464
- <termref base='IEV' target='xyz'/>
1465
- </origin>
1466
- </termsource>
1467
- <termsource status='identical' type="authoritative">
1468
- <origin citeas=''>
1469
- <termref base='IEV' target='xyz'/>
1470
- </origin>
1471
- </termsource>
1472
- <termsource status='identical' type="authoritative">
1473
- <origin citeas=''>
1474
- <termref base='IEV' target='xyz'/>
1475
- </origin>
1476
- </termsource>
1477
- </term>
1478
- </terms>
1479
- </sections>
1480
- </standard-document>
1481
- OUTPUT
1482
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
1483
- .to be_equivalent_to xmlpp(output)
1484
- end
1485
-
1486
- it "processes modified term sources" do
1487
- input = <<~INPUT
1488
- #{ASCIIDOC_BLANK_HDR}
1489
- == Terms and Definitions
1490
-
1491
- === Term1
1492
-
1493
- Definition 0
1494
-
1495
- [.source]
1496
- <<ISO2191,section=1>>, with adjustments
1497
-
1498
- === Term2
1499
-
1500
- Definition
1501
-
1502
- [.source]
1503
- {{<<IEV:xyz>>}}, with adjustments
1504
- INPUT
1505
- output = <<~OUTPUT
1506
- #{BLANK_HDR}
1507
- <sections>
1508
- <terms id="_" obligation="normative">
1509
- <title>Terms and definitions</title>
1510
- <p id="_">For the purposes of this document,
1511
- the following terms and definitions apply.</p>
1512
- <term id="term-Term1">
1513
- <preferred><expression><name>Term1</name></expression></preferred>
1514
- <definition><verbal-definition><p id='_'>Definition 0</p></verbal-definition></definition>
1515
- <termsource status="modified" type="authoritative">
1516
- <origin bibitemid="ISO2191" type="inline" citeas="">
1517
- <localityStack>
1518
- <locality type="section"><referenceFrom>1</referenceFrom></locality>
1519
- </localityStack>
1520
- </origin>
1521
- <modification>
1522
- <p id="_">with adjustments</p>
1523
- </modification>
1524
- </termsource>
1525
- </term>
1526
- <term id='term-Term2'>
1527
- <preferred><expression><name>Term2</name></expression></preferred>
1528
- <definition><verbal-definition>
1529
- <p id='_'>Definition</p>
1530
- </verbal-definition></definition>
1531
- <termsource status='modified' type="authoritative">
1532
- <origin citeas=''>
1533
- <termref base='IEV' target='xyz'/>
1534
- </origin>
1535
- <modification>
1536
- <p id='_'>with adjustments</p>
1537
- </modification>
1538
- </termsource>
1539
- </term>
1540
- </terms>
1541
- </sections>
1542
- </standard-document>
1543
- OUTPUT
1544
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
1545
- .to be_equivalent_to xmlpp(output)
1546
- end
1547
-
1548
- it "processes term source attributes" do
1549
- input = <<~INPUT
1550
- #{ASCIIDOC_BLANK_HDR}
1551
- == Terms and Definitions
1552
-
1553
- === Term1
1554
-
1555
- Definition 0
1556
-
1557
- [.source,status=generalisation]
1558
- <<ISO2191,section=1>>, with adjustments
1559
-
1560
- === Term2
1561
-
1562
- Definition
1563
-
1564
- [.source,type=lineage]
1565
- {{<<IEV:xyz>>}}, with adjustments
1566
- INPUT
1567
- output = <<~OUTPUT
1568
- #{BLANK_HDR}
1569
- <sections>
1570
- <terms id='_' obligation='normative'>
1571
- <title>Terms and definitions</title>
1572
- <p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
1573
- <term id='term-Term1'>
1574
- <preferred>
1575
- <expression>
1576
- <name>Term1</name>
1577
- </expression>
1578
- </preferred>
1579
- <definition><verbal-definition><p id='_'>Definition 0</p></verbal-definition></definition>
1580
- <termsource status='generalisation' type='authoritative'>
1581
- <origin bibitemid='ISO2191' type='inline' citeas=''>
1582
- <localityStack>
1583
- <locality type='section'>
1584
- <referenceFrom>1</referenceFrom>
1585
- </locality>
1586
- </localityStack>
1587
- </origin>
1588
- <modification>
1589
- <p id='_'>with adjustments</p>
1590
- </modification>
1591
- </termsource>
1592
- </term>
1593
- <term id='term-Term2'>
1594
- <preferred>
1595
- <expression>
1596
- <name>Term2</name>
1597
- </expression>
1598
- </preferred>
1599
- <definition><verbal-definition>
1600
- <p id='_'>Definition</p>
1601
- </verbal-definition></definition>
1602
- <termsource status='modified' type='lineage'>
1603
- <origin citeas=''>
1604
- <termref base='IEV' target='xyz'/>
1605
- </origin>
1606
- <modification>
1607
- <p id='_'>with adjustments</p>
1608
- </modification>
1609
- </termsource>
1610
- </term>
1611
- </terms>
1612
- </sections>
1613
- </standard-document>
1614
- OUTPUT
1615
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
1616
- .to be_equivalent_to xmlpp(output)
1617
- end
1618
-
1619
- it "processes delete change clauses" do
1620
- input = <<~"INPUT"
1621
- #{ASCIIDOC_BLANK_HDR}
1622
- [change="modify",locality="page=27",path="//table[2]",path_end="//table[2]/following-sibling:example[1]",title="Change"]
1623
- ==== Change Clause
1624
- _This table contains information on polygon cells which are not included in ISO 10303-52. Remove table 2 completely and replace with:_
1625
- INPUT
1626
- output = <<~"OUTPUT"
1627
- #{BLANK_HDR}
1628
- <sections>
1629
- <clause id='_' inline-header='false' obligation='normative'>
1630
- <title>Change Clause</title>
1631
- <amend id='_' change='modify' path='//table[2]' path_end='//table[2]/following-sibling:example[1]' title='Change'>
1632
- <description>
1633
- <p id='_'>
1634
- <em>
1635
- This table contains information on polygon cells which are not
1636
- included in ISO 10303-52. Remove table 2 completely and replace
1637
- with:
1638
- </em>
1639
- </p>
1640
- </description>
1641
- </amend>
1642
- </clause>
1643
- </sections>
1644
- </standard-document>
1645
- OUTPUT
1646
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
1647
- .to be_equivalent_to xmlpp(output)
1648
- end
1649
-
1650
- it "processes modify change clauses" do
1651
- input = <<~"INPUT"
1652
- #{ASCIIDOC_BLANK_HDR}
1653
- [change="modify",locality="page=27",path="//table[2]",path_end="//table[2]/following-sibling:example[1]",title="Change"]
1654
- ==== Change Clause
1655
-
1656
- autonumber:table[2]
1657
- autonumber:note[7]
1658
-
1659
- _This table contains information on polygon cells which are not included in ISO 10303-52. Remove table 2 completely and replace with:_
1660
-
1661
- ____
1662
- .Edges of triangle and quadrilateral cells
1663
- |===
1664
- 2+^.^h| triangle 2+^.^h| quadrilateral
1665
- ^.^| edge ^.^| vertices ^.^| edge ^.^| vertices
1666
- ^.^| 1 ^.^| 1, 2 ^.^| 1 ^.^| 1, 2
1667
- ^.^| 2 ^.^| 2, 3 ^.^| 2 ^.^| 2, 3
1668
- ^.^| 3 ^.^| 3, 1 ^.^| 3 ^.^| 3, 4
1669
- | | ^.^| 4 ^.^| 4, 1
1670
- |===
1671
-
1672
- ====
1673
- This is not generalised further.
1674
- ====
1675
-
1676
- ____
1677
-
1678
- Any further exceptions can be ignored.
1679
- INPUT
1680
-
1681
- output = <<~"OUTPUT"
1682
- #{BLANK_HDR}
1683
- <sections>
1684
- <clause id='_' inline-header='false' obligation='normative'>
1685
- <title>Change Clause</title>
1686
- <amend id='_' change='modify' path='//table[2]' path_end='//table[2]/following-sibling:example[1]' title='Change'>
1687
- <autonumber type='table'>2</autonumber>
1688
- <autonumber type='note'>7</autonumber>
1689
- <description>
1690
- <p id='_'>
1691
- <em>
1692
- This table contains information on polygon cells which are not
1693
- included in ISO 10303-52. Remove table 2 completely and replace
1694
- with:
1695
- </em>
1696
- </p>
1697
- </description>
1698
- <newcontent id='_'>
1699
- <table id='_'>
1700
- <name>Edges of triangle and quadrilateral cells</name>
1701
- <tbody>
1702
- <tr>
1703
- <th colspan='2' valign='middle' align='center'>triangle</th>
1704
- <th colspan='2' valign='middle' align='center'>quadrilateral</th>
1705
- </tr>
1706
- <tr>
1707
- <td valign='middle' align='center'>edge</td>
1708
- <td valign='middle' align='center'>vertices</td>
1709
- <td valign='middle' align='center'>edge</td>
1710
- <td valign='middle' align='center'>vertices</td>
1711
- </tr>
1712
- <tr>
1713
- <td valign='middle' align='center'>1</td>
1714
- <td valign='middle' align='center'>1, 2</td>
1715
- <td valign='middle' align='center'>1</td>
1716
- <td valign='middle' align='center'>1, 2</td>
1717
- </tr>
1718
- <tr>
1719
- <td valign='middle' align='center'>2</td>
1720
- <td valign='middle' align='center'>2, 3</td>
1721
- <td valign='middle' align='center'>2</td>
1722
- <td valign='middle' align='center'>2, 3</td>
1723
- </tr>
1724
- <tr>
1725
- <td valign='middle' align='center'>3</td>
1726
- <td valign='middle' align='center'>3, 1</td>
1727
- <td valign='middle' align='center'>3</td>
1728
- <td valign='middle' align='center'>3, 4</td>
1729
- </tr>
1730
- <tr>
1731
- <td valign='top' align='left'/>
1732
- <td valign='top' align='left'/>
1733
- <td valign='middle' align='center'>4</td>
1734
- <td valign='middle' align='center'>4, 1</td>
1735
- </tr>
1736
- </tbody>
1737
- </table>
1738
- <example id='_'>
1739
- <p id='_'>This is not generalised further.</p>
1740
- </example>
1741
- </newcontent>
1742
- <description>
1743
- <p id='_'>Any further exceptions can be ignored.</p>
1744
- </description>
1745
- </amend>
1746
- </clause>
1747
- </sections>
1748
- </standard-document>
1749
- OUTPUT
1750
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
1751
- .to be_equivalent_to xmlpp(output)
1752
- end
1753
-
1754
- it "processes hard breaks" do
1755
- input = <<~INPUT
1756
- #{ASCIIDOC_BLANK_HDR}
1757
-
1758
- [%hardbreaks]
1759
- One hardbreak
1760
- Two
1761
-
1762
- Three hardbreaks +
1763
- Four
1764
- INPUT
1765
- output = <<~OUTPUT
1766
- #{BLANK_HDR}
1767
- <sections>
1768
- <p id='_'>
1769
- One hardbreak
1770
- <br/>
1771
- Two
1772
- </p>
1773
- <p id='_'>
1774
- Three hardbreaks
1775
- <br/>
1776
- Four
1777
- </p>
1778
- </sections>
1779
- </standard-document>
1780
- OUTPUT
1781
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
1782
- .to be_equivalent_to xmlpp(output)
1783
- end
1784
- end