metanorma-standoc 1.8.7 → 1.9.3

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