metanorma-standoc 1.3.6 → 1.3.7
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.
- checksums.yaml +4 -4
- data/.github/workflows/ubuntu.yml +0 -1
- data/Gemfile.lock +22 -18
- data/README.adoc +4 -4
- data/lib/asciidoctor/standoc/base.rb +1 -0
- data/lib/asciidoctor/standoc/basicdoc.rng +6 -8
- data/lib/asciidoctor/standoc/blocks.rb +15 -0
- data/lib/asciidoctor/standoc/cleanup.rb +9 -16
- data/lib/asciidoctor/standoc/inline.rb +4 -3
- data/lib/asciidoctor/standoc/macros.rb +20 -2
- data/lib/asciidoctor/standoc/ref.rb +79 -67
- data/lib/asciidoctor/standoc/section.rb +1 -1
- data/lib/metanorma/standoc/version.rb +1 -1
- data/metanorma-standoc.gemspec +1 -1
- data/spec/asciidoctor-standoc/base_spec.rb +15 -3
- data/spec/asciidoctor-standoc/blocks_spec.rb +37 -41
- data/spec/asciidoctor-standoc/cleanup_spec.rb +62 -55
- data/spec/asciidoctor-standoc/inline_spec.rb +10 -10
- data/spec/asciidoctor-standoc/lists_spec.rb +3 -3
- data/spec/asciidoctor-standoc/macros_spec.rb +30 -7
- data/spec/asciidoctor-standoc/refs_dl_spec.rb +3 -3
- data/spec/asciidoctor-standoc/refs_spec.rb +43 -13
- data/spec/asciidoctor-standoc/section_spec.rb +81 -63
- data/spec/asciidoctor-standoc/table_spec.rb +4 -4
- data/spec/spec_helper.rb +9 -0
- metadata +4 -4
@@ -197,7 +197,7 @@ module Asciidoctor
|
|
197
197
|
|
198
198
|
def introduction_parse(attrs, xml, node)
|
199
199
|
xml.introduction **attr_code(attrs) do |xml_section|
|
200
|
-
xml_section.title
|
200
|
+
xml_section.title { |t| t << "Introduction" }
|
201
201
|
content = node.content
|
202
202
|
xml_section << content
|
203
203
|
end
|
data/metanorma-standoc.gemspec
CHANGED
@@ -26,7 +26,7 @@ Gem::Specification.new do |spec|
|
|
26
26
|
spec.test_files = `git ls-files -- {spec}/*`.split("\n")
|
27
27
|
spec.required_ruby_version = Gem::Requirement.new(">= 2.4.0")
|
28
28
|
|
29
|
-
spec.add_dependency "asciidoctor", "~>
|
29
|
+
spec.add_dependency "asciidoctor", "~> 2.0.0"
|
30
30
|
spec.add_dependency "ruby-jing"
|
31
31
|
spec.add_dependency "isodoc", "~> 1.0.0"
|
32
32
|
spec.add_dependency "iev", "~> 0.2.1"
|
@@ -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(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)).to be_equivalent_to <<~"OUTPUT"
|
21
|
+
expect(xmlpp(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
22
22
|
= Document title
|
23
23
|
Author
|
24
24
|
:docfile: test.adoc
|
@@ -33,7 +33,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
33
33
|
end
|
34
34
|
|
35
35
|
it "processes default metadata" do
|
36
|
-
expect(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)).to be_equivalent_to <<~'OUTPUT'
|
36
|
+
expect(xmlpp(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to xmlpp(<<~'OUTPUT')
|
37
37
|
= Document title
|
38
38
|
Author
|
39
39
|
:docfile: test.adoc
|
@@ -273,7 +273,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
273
273
|
end
|
274
274
|
|
275
275
|
it "processes complex metadata" do
|
276
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))
|
276
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
277
277
|
= Document title
|
278
278
|
Author
|
279
279
|
:docfile: test.adoc
|
@@ -384,6 +384,18 @@ RSpec.describe Asciidoctor::Standoc do
|
|
384
384
|
<doctype>article</doctype>
|
385
385
|
</ext>
|
386
386
|
</bibdata>
|
387
|
+
<preface>
|
388
|
+
<abstract id='_'>
|
389
|
+
<p id='_'>This is the abstract of the document</p>
|
390
|
+
<p id='_'>This is the second paragraph of the abstract of the document.</p>
|
391
|
+
</abstract>
|
392
|
+
</preface>
|
393
|
+
<sections>
|
394
|
+
<clause id='_' language='en' inline-header='false' obligation='normative'>
|
395
|
+
<title>Clause 1</title>
|
396
|
+
</clause>
|
397
|
+
</sections>
|
398
|
+
</standard-document>
|
387
399
|
OUTPUT
|
388
400
|
end
|
389
401
|
|
@@ -3,7 +3,7 @@ require "open3"
|
|
3
3
|
|
4
4
|
RSpec.describe Asciidoctor::Standoc do
|
5
5
|
it "processes pass blocks" do
|
6
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
6
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
7
7
|
#{ASCIIDOC_BLANK_HDR}
|
8
8
|
|
9
9
|
++++
|
@@ -19,7 +19,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
19
19
|
end
|
20
20
|
|
21
21
|
it "processes open blocks" do
|
22
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
22
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
23
23
|
#{ASCIIDOC_BLANK_HDR}
|
24
24
|
--
|
25
25
|
x
|
@@ -37,9 +37,8 @@ RSpec.describe Asciidoctor::Standoc do
|
|
37
37
|
OUTPUT
|
38
38
|
end
|
39
39
|
|
40
|
-
=begin
|
41
40
|
it "processes stem blocks" do
|
42
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
41
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
43
42
|
#{ASCIIDOC_BLANK_HDR}
|
44
43
|
[stem%inequality]
|
45
44
|
++++
|
@@ -230,13 +229,11 @@ RSpec.describe Asciidoctor::Standoc do
|
|
230
229
|
</math></stem>
|
231
230
|
</formula>
|
232
231
|
</sections></standard-document>
|
233
|
-
</sections>
|
234
|
-
</standard-document>
|
235
232
|
OUTPUT
|
236
233
|
end
|
237
|
-
|
234
|
+
|
238
235
|
it "ignores review blocks unless document is in draft mode" do
|
239
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
236
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
240
237
|
#{ASCIIDOC_BLANK_HDR}
|
241
238
|
[[foreword]]
|
242
239
|
.Foreword
|
@@ -257,7 +254,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
257
254
|
end
|
258
255
|
|
259
256
|
it "processes review blocks if document is in draft mode" do
|
260
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
257
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
261
258
|
= Document title
|
262
259
|
Author
|
263
260
|
:docfile: test.adoc
|
@@ -303,7 +300,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
303
300
|
end
|
304
301
|
|
305
302
|
it "processes term notes" do
|
306
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
303
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
307
304
|
#{ASCIIDOC_BLANK_HDR}
|
308
305
|
== Terms and Definitions
|
309
306
|
|
@@ -329,7 +326,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
329
326
|
end
|
330
327
|
|
331
328
|
it "processes term notes as plain notes in nonterm clauses" do
|
332
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
329
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
333
330
|
#{ASCIIDOC_BLANK_HDR}
|
334
331
|
== Terms and Definitions
|
335
332
|
|
@@ -357,7 +354,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
357
354
|
end
|
358
355
|
|
359
356
|
it "processes term notes as plain notes in definitions subclauses of terms & definitions" do
|
360
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
357
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
361
358
|
#{ASCIIDOC_BLANK_HDR}
|
362
359
|
== Terms and Definitions
|
363
360
|
|
@@ -387,7 +384,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
387
384
|
end
|
388
385
|
|
389
386
|
it "processes notes" do
|
390
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
387
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
391
388
|
#{ASCIIDOC_BLANK_HDR}
|
392
389
|
NOTE: This is a note
|
393
390
|
|
@@ -416,7 +413,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
416
413
|
end
|
417
414
|
|
418
415
|
it "processes literals" do
|
419
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
416
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
420
417
|
#{ASCIIDOC_BLANK_HDR}
|
421
418
|
....
|
422
419
|
<LITERAL>
|
@@ -434,7 +431,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
434
431
|
end
|
435
432
|
|
436
433
|
it "processes simple admonitions with Asciidoc names" do
|
437
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
434
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
438
435
|
#{ASCIIDOC_BLANK_HDR}
|
439
436
|
CAUTION: Only use paddy or parboiled rice for the determination of husked rice yield.
|
440
437
|
INPUT
|
@@ -451,7 +448,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
451
448
|
|
452
449
|
|
453
450
|
it "processes complex admonitions with non-Asciidoc names" do
|
454
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
451
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
455
452
|
#{ASCIIDOC_BLANK_HDR}
|
456
453
|
[CAUTION,type=Safety Precautions]
|
457
454
|
.Precautions
|
@@ -484,7 +481,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
484
481
|
end
|
485
482
|
|
486
483
|
it "processes term examples" do
|
487
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
484
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
488
485
|
#{ASCIIDOC_BLANK_HDR}
|
489
486
|
== Terms and Definitions
|
490
487
|
|
@@ -511,7 +508,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
511
508
|
end
|
512
509
|
|
513
510
|
it "processes term examples as plain examples in nonterm clauses" do
|
514
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
511
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
515
512
|
#{ASCIIDOC_BLANK_HDR}
|
516
513
|
== Terms and Definitions
|
517
514
|
|
@@ -539,7 +536,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
539
536
|
end
|
540
537
|
|
541
538
|
it "processes term examples as plain examples in definitions subclauses of terms & definitions" do
|
542
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
539
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
543
540
|
#{ASCIIDOC_BLANK_HDR}
|
544
541
|
== Terms and Definitions
|
545
542
|
|
@@ -569,7 +566,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
569
566
|
|
570
567
|
|
571
568
|
it "processes examples" do
|
572
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
569
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
573
570
|
#{ASCIIDOC_BLANK_HDR}
|
574
571
|
[example,subsequence=A]
|
575
572
|
.Title
|
@@ -597,7 +594,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
597
594
|
end
|
598
595
|
|
599
596
|
it "processes preambles" do
|
600
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
597
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
601
598
|
#{ASCIIDOC_BLANK_HDR}
|
602
599
|
This is a preamble
|
603
600
|
|
@@ -616,7 +613,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
616
613
|
end
|
617
614
|
|
618
615
|
it "processes preambles with titles" do
|
619
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
616
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
620
617
|
#{ASCIIDOC_BLANK_HDR}
|
621
618
|
.Preamble
|
622
619
|
This is a preamble
|
@@ -636,7 +633,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
636
633
|
end
|
637
634
|
|
638
635
|
it "processes subfigures" do
|
639
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
636
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
640
637
|
#{ASCIIDOC_BLANK_HDR}
|
641
638
|
[[figureC-2]]
|
642
639
|
.Stages of gelatinization
|
@@ -671,7 +668,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
671
668
|
end
|
672
669
|
|
673
670
|
it "processes figures within examples" do
|
674
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
671
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
675
672
|
#{ASCIIDOC_BLANK_HDR}
|
676
673
|
[[figureC-2]]
|
677
674
|
.Stages of gelatinization
|
@@ -710,7 +707,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
710
707
|
|
711
708
|
|
712
709
|
it "processes images" do
|
713
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
710
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
714
711
|
#{ASCIIDOC_BLANK_HDR}
|
715
712
|
[%unnumbered]
|
716
713
|
.Split-it-right sample divider
|
@@ -729,7 +726,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
729
726
|
end
|
730
727
|
|
731
728
|
it "processes data URI images" do
|
732
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
729
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
733
730
|
#{ASCIIDOC_BLANK_HDR}
|
734
731
|
[subsequence=A]
|
735
732
|
.Split-it-right sample divider
|
@@ -748,7 +745,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
748
745
|
end
|
749
746
|
|
750
747
|
it "accepts attributes on images" do
|
751
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
748
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
752
749
|
#{ASCIIDOC_BLANK_HDR}
|
753
750
|
[height=4,width=3,alt="IMAGE",filename="riceimg1.png",titleattr="TITLE"]
|
754
751
|
.Caption
|
@@ -766,7 +763,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
766
763
|
end
|
767
764
|
|
768
765
|
it "accepts auto for width and height attributes on images" do
|
769
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
766
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
770
767
|
#{ASCIIDOC_BLANK_HDR}
|
771
768
|
[height=4,width=auto]
|
772
769
|
image::spec/examples/rice_images/rice_image1.png[]
|
@@ -783,7 +780,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
783
780
|
end
|
784
781
|
|
785
782
|
it "processes inline images with width and height attributes on images" do
|
786
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
783
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
787
784
|
#{ASCIIDOC_BLANK_HDR}
|
788
785
|
Hello image:spec/examples/rice_images/rice_image1.png[alt, 4, 3], how are you?
|
789
786
|
|
@@ -791,7 +788,6 @@ RSpec.describe Asciidoctor::Standoc do
|
|
791
788
|
#{BLANK_HDR}
|
792
789
|
<sections>
|
793
790
|
<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>
|
794
|
-
</figure>
|
795
791
|
</sections>
|
796
792
|
</standard-document>
|
797
793
|
OUTPUT
|
@@ -813,7 +809,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
813
809
|
end
|
814
810
|
|
815
811
|
it "accepts alignment attribute on paragraphs" do
|
816
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
812
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
817
813
|
#{ASCIIDOC_BLANK_HDR}
|
818
814
|
[align=right]
|
819
815
|
This para is right-aligned.
|
@@ -827,7 +823,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
827
823
|
end
|
828
824
|
|
829
825
|
it "processes blockquotes" do
|
830
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
826
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
831
827
|
#{ASCIIDOC_BLANK_HDR}
|
832
828
|
[quote, ISO, "ISO7301,section 1"]
|
833
829
|
____
|
@@ -847,7 +843,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
847
843
|
end
|
848
844
|
|
849
845
|
it "processes source code" do
|
850
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
846
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
851
847
|
#{ASCIIDOC_BLANK_HDR}
|
852
848
|
.Caption
|
853
849
|
[source,ruby,filename=sourcecode1.rb]
|
@@ -870,7 +866,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
870
866
|
end
|
871
867
|
|
872
868
|
it "processes callouts" do
|
873
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
869
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
874
870
|
#{ASCIIDOC_BLANK_HDR}
|
875
871
|
[source,ruby]
|
876
872
|
--
|
@@ -897,7 +893,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
897
893
|
end
|
898
894
|
|
899
895
|
it "processes unmodified term sources" do
|
900
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
896
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
901
897
|
#{ASCIIDOC_BLANK_HDR}
|
902
898
|
== Terms and Definitions
|
903
899
|
|
@@ -924,7 +920,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
924
920
|
end
|
925
921
|
|
926
922
|
it "processes modified term sources" do
|
927
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
923
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
928
924
|
#{ASCIIDOC_BLANK_HDR}
|
929
925
|
== Terms and Definitions
|
930
926
|
|
@@ -975,7 +971,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
975
971
|
</standard-document>
|
976
972
|
OUTPUT
|
977
973
|
|
978
|
-
expect(strip_guid(Asciidoctor.convert(input, backend: :standoc, header_footer: true))).to be_equivalent_to output
|
974
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(output)
|
979
975
|
end
|
980
976
|
|
981
977
|
it "processes requirement" do
|
@@ -997,7 +993,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
997
993
|
</standard-document>
|
998
994
|
OUTPUT
|
999
995
|
|
1000
|
-
expect(strip_guid(Asciidoctor.convert(input, backend: :standoc, header_footer: true))).to be_equivalent_to output
|
996
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(output)
|
1001
997
|
end
|
1002
998
|
|
1003
999
|
it "processes permission" do
|
@@ -1018,7 +1014,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
1018
1014
|
</standard-document>
|
1019
1015
|
OUTPUT
|
1020
1016
|
|
1021
|
-
expect(strip_guid(Asciidoctor.convert(input, backend: :standoc, header_footer: true))).to be_equivalent_to output
|
1017
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(output)
|
1022
1018
|
end
|
1023
1019
|
|
1024
1020
|
|
@@ -1053,7 +1049,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
1053
1049
|
</standard-document>
|
1054
1050
|
OUTPUT
|
1055
1051
|
|
1056
|
-
expect(strip_guid(Asciidoctor.convert(input, backend: :standoc, header_footer: true))).to be_equivalent_to output
|
1052
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(output)
|
1057
1053
|
end
|
1058
1054
|
|
1059
1055
|
it "processes recommendation with internal markup of structure" do
|
@@ -1123,7 +1119,7 @@ end</sourcecode></verification>
|
|
1123
1119
|
</standard-document>
|
1124
1120
|
OUTPUT
|
1125
1121
|
|
1126
|
-
expect(strip_guid(Asciidoctor.convert(input, backend: :standoc, header_footer: true))).to be_equivalent_to output
|
1122
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(output)
|
1127
1123
|
end
|
1128
1124
|
|
1129
1125
|
end
|
@@ -4,14 +4,14 @@ require "fileutils"
|
|
4
4
|
|
5
5
|
RSpec.describe Asciidoctor::Standoc do
|
6
6
|
it "applies smartquotes by default" do
|
7
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
7
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
8
8
|
#{ASCIIDOC_BLANK_HDR}
|
9
|
-
== "Quotation"
|
9
|
+
== "Quotation" A's
|
10
10
|
INPUT
|
11
11
|
#{BLANK_HDR}
|
12
12
|
<sections>
|
13
13
|
<clause id="_" inline-header="false" obligation="normative">
|
14
|
-
<title>“Quotation
|
14
|
+
<title>“Quotation” A’s</title>
|
15
15
|
</clause>
|
16
16
|
</sections>
|
17
17
|
</standard-document>
|
@@ -19,7 +19,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
19
19
|
end
|
20
20
|
|
21
21
|
it "applies smartquotes when requested" do
|
22
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
22
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
23
23
|
= Document title
|
24
24
|
Author
|
25
25
|
:docfile: test.adoc
|
@@ -28,12 +28,12 @@ RSpec.describe Asciidoctor::Standoc do
|
|
28
28
|
:no-isobib:
|
29
29
|
:smartquotes: true
|
30
30
|
|
31
|
-
== "Quotation"
|
31
|
+
== "Quotation" A's
|
32
32
|
INPUT
|
33
33
|
#{BLANK_HDR}
|
34
34
|
<sections>
|
35
35
|
<clause id="_" inline-header="false" obligation="normative">
|
36
|
-
<title>“Quotation
|
36
|
+
<title>“Quotation” A’s</title>
|
37
37
|
</clause>
|
38
38
|
</sections>
|
39
39
|
</standard-document>
|
@@ -41,7 +41,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
41
41
|
end
|
42
42
|
|
43
43
|
it "does not apply smartquotes when requested not to" do
|
44
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
44
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
45
45
|
= Document title
|
46
46
|
Author
|
47
47
|
:docfile: test.adoc
|
@@ -50,12 +50,17 @@ RSpec.describe Asciidoctor::Standoc do
|
|
50
50
|
:no-isobib:
|
51
51
|
:smartquotes: false
|
52
52
|
|
53
|
-
== "Quotation"
|
53
|
+
== "Quotation" A's
|
54
|
+
|
55
|
+
`"quote" A's`
|
54
56
|
INPUT
|
55
57
|
#{BLANK_HDR}
|
56
58
|
<sections>
|
57
59
|
<clause id="_" inline-header="false" obligation="normative">
|
58
|
-
<title>"Quotation"</title>
|
60
|
+
<title>"Quotation" A's</title>
|
61
|
+
<p id="_">
|
62
|
+
<tt>"quote" A's</tt>
|
63
|
+
</p>
|
59
64
|
</clause>
|
60
65
|
</sections>
|
61
66
|
</standard-document>
|
@@ -63,7 +68,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
63
68
|
end
|
64
69
|
|
65
70
|
it "does not apply smartquotes to sourcecode, tt, pre" do
|
66
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
71
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
67
72
|
= Document title
|
68
73
|
Author
|
69
74
|
:docfile: test.adoc
|
@@ -72,32 +77,32 @@ RSpec.describe Asciidoctor::Standoc do
|
|
72
77
|
:no-isobib:
|
73
78
|
:smartquotes: true
|
74
79
|
|
75
|
-
== "Quotation"
|
80
|
+
== "Quotation" A's
|
76
81
|
|
77
|
-
"Quotation"
|
82
|
+
"Quotation" A's
|
78
83
|
|
79
|
-
`"quote"`
|
84
|
+
`"quote" A's`
|
80
85
|
|
81
86
|
[source]
|
82
87
|
----
|
83
|
-
"quote"
|
88
|
+
"quote" A's
|
84
89
|
----
|
85
90
|
|
86
91
|
INPUT
|
87
92
|
#{BLANK_HDR}
|
88
93
|
<sections>
|
89
|
-
<clause id="_" inline-header="false" obligation="normative"><title>“Quotation
|
94
|
+
<clause id="_" inline-header="false" obligation="normative"><title>“Quotation” A’s</title><p id="_">“Quotation” A’s</p>
|
90
95
|
<p id="_">
|
91
|
-
<tt>"quote"</tt>
|
96
|
+
<tt>"quote" A’s</tt>
|
92
97
|
</p>
|
93
|
-
<sourcecode id="_">"quote"</sourcecode></clause>
|
98
|
+
<sourcecode id="_">"quote" A's</sourcecode></clause>
|
94
99
|
</sections>
|
95
100
|
</standard-document>
|
96
101
|
OUTPUT
|
97
102
|
end
|
98
103
|
|
99
104
|
it "handles < > & in Asciidoctor correctly" do
|
100
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
105
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
101
106
|
#{ASCIIDOC_BLANK_HDR}
|
102
107
|
== {blank}
|
103
108
|
|
@@ -114,7 +119,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
114
119
|
end
|
115
120
|
|
116
121
|
it "removes empty text elements" do
|
117
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
122
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
118
123
|
#{ASCIIDOC_BLANK_HDR}
|
119
124
|
== {blank}
|
120
125
|
INPUT
|
@@ -129,7 +134,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
129
134
|
end
|
130
135
|
|
131
136
|
it "processes stem-only terms as admitted" do
|
132
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
137
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
133
138
|
#{ASCIIDOC_BLANK_HDR}
|
134
139
|
== Terms and Definitions
|
135
140
|
|
@@ -153,7 +158,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
153
158
|
end
|
154
159
|
|
155
160
|
it "moves term domains out of the term definition paragraph" do
|
156
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
161
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
157
162
|
#{ASCIIDOC_BLANK_HDR}
|
158
163
|
== Terms and Definitions
|
159
164
|
|
@@ -177,7 +182,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
177
182
|
end
|
178
183
|
|
179
184
|
it "permits multiple blocks in term definition paragraph" do
|
180
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
185
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
181
186
|
= Document title
|
182
187
|
Author
|
183
188
|
:docfile: test.adoc
|
@@ -213,7 +218,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
213
218
|
end
|
214
219
|
|
215
220
|
it "strips any initial boilerplate from terms and definitions" do
|
216
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
221
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
217
222
|
#{ASCIIDOC_BLANK_HDR}
|
218
223
|
== Terms and Definitions
|
219
224
|
|
@@ -240,7 +245,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
240
245
|
end
|
241
246
|
|
242
247
|
it "moves notes inside preceding blocks, if they are not at clause end, and the blocks are not delimited" do
|
243
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
248
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
244
249
|
#{ASCIIDOC_BLANK_HDR}
|
245
250
|
|
246
251
|
[stem]
|
@@ -266,7 +271,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
266
271
|
end
|
267
272
|
|
268
273
|
it "does not move notes inside preceding blocks, if they are at clause end" do
|
269
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
274
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
270
275
|
#{ASCIIDOC_BLANK_HDR}
|
271
276
|
[source,ruby]
|
272
277
|
[1...x].each do |y|
|
@@ -287,7 +292,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
287
292
|
end
|
288
293
|
|
289
294
|
it "converts xrefs to references into erefs" do
|
290
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
295
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
291
296
|
#{ASCIIDOC_BLANK_HDR}
|
292
297
|
<<iso216>>
|
293
298
|
|
@@ -319,13 +324,13 @@ RSpec.describe Asciidoctor::Standoc do
|
|
319
324
|
</contributor>
|
320
325
|
</bibitem>
|
321
326
|
</references>
|
322
|
-
</bibliography
|
327
|
+
</bibliography>
|
323
328
|
</standard-document>
|
324
329
|
OUTPUT
|
325
330
|
end
|
326
331
|
|
327
332
|
it "extracts localities from erefs" do
|
328
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
333
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
329
334
|
#{ASCIIDOC_BLANK_HDR}
|
330
335
|
<<iso216,whole,clause=3,example=9-11,locality:prelude=33,locality:entirety:the reference>>
|
331
336
|
|
@@ -361,7 +366,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
361
366
|
|
362
367
|
|
363
368
|
it "strips type from xrefs" do
|
364
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
369
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
365
370
|
#{ASCIIDOC_BLANK_HDR}
|
366
371
|
<<iso216>>
|
367
372
|
|
@@ -395,7 +400,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
395
400
|
end
|
396
401
|
|
397
402
|
it "processes localities in term sources" do
|
398
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
403
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
399
404
|
#{ASCIIDOC_BLANK_HDR}
|
400
405
|
== Terms and Definitions
|
401
406
|
|
@@ -422,7 +427,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
422
427
|
end
|
423
428
|
|
424
429
|
it "removes extraneous material from Normative References" do
|
425
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
430
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
426
431
|
#{ASCIIDOC_BLANK_HDR}
|
427
432
|
[bibliography]
|
428
433
|
== Normative References
|
@@ -452,7 +457,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
452
457
|
end
|
453
458
|
|
454
459
|
it "inserts IDs into paragraphs" do
|
455
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
460
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
456
461
|
#{ASCIIDOC_BLANK_HDR}
|
457
462
|
Paragraph
|
458
463
|
INPUT
|
@@ -465,7 +470,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
465
470
|
end
|
466
471
|
|
467
472
|
it "inserts IDs into notes" do
|
468
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
473
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
469
474
|
#{ASCIIDOC_BLANK_HDR}
|
470
475
|
[example]
|
471
476
|
====
|
@@ -485,7 +490,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
485
490
|
end
|
486
491
|
|
487
492
|
it "moves table key inside table" do
|
488
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
493
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
489
494
|
#{ASCIIDOC_BLANK_HDR}
|
490
495
|
|===
|
491
496
|
|a |b |c
|
@@ -517,7 +522,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
517
522
|
end
|
518
523
|
|
519
524
|
it "processes headerrows attribute for table without header rows" do
|
520
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
525
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
521
526
|
#{ASCIIDOC_BLANK_HDR}
|
522
527
|
[headerrows=3]
|
523
528
|
|===
|
@@ -556,7 +561,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
556
561
|
end
|
557
562
|
|
558
563
|
it "processes headerrows attribute for table with header rows" do
|
559
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
564
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
560
565
|
#{ASCIIDOC_BLANK_HDR}
|
561
566
|
[headerrows=3]
|
562
567
|
|===
|
@@ -601,7 +606,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
601
606
|
end
|
602
607
|
|
603
608
|
it "moves table notes inside table" do
|
604
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
609
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
605
610
|
#{ASCIIDOC_BLANK_HDR}
|
606
611
|
|===
|
607
612
|
|a |b |c
|
@@ -627,11 +632,12 @@ RSpec.describe Asciidoctor::Standoc do
|
|
627
632
|
</note></table>
|
628
633
|
|
629
634
|
</sections>
|
635
|
+
</standard-document>
|
630
636
|
OUTPUT
|
631
637
|
end
|
632
638
|
|
633
639
|
it "moves formula key inside formula" do
|
634
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
640
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
635
641
|
#{ASCIIDOC_BLANK_HDR}
|
636
642
|
[stem]
|
637
643
|
++++
|
@@ -658,7 +664,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
658
664
|
end
|
659
665
|
|
660
666
|
it "moves footnotes inside figures" do
|
661
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
667
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
662
668
|
#{ASCIIDOC_BLANK_HDR}
|
663
669
|
image::spec/examples/rice_images/rice_image1.png[]
|
664
670
|
|
@@ -682,7 +688,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
682
688
|
end
|
683
689
|
|
684
690
|
it "moves figure key inside figure" do
|
685
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
691
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
686
692
|
#{ASCIIDOC_BLANK_HDR}
|
687
693
|
image::spec/examples/rice_images/rice_image1.png[]
|
688
694
|
|
@@ -707,7 +713,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
707
713
|
end
|
708
714
|
|
709
715
|
it "processes subfigures" do
|
710
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
716
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
711
717
|
#{ASCIIDOC_BLANK_HDR}
|
712
718
|
[[figureC-2]]
|
713
719
|
.Stages of gelatinization
|
@@ -742,7 +748,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
742
748
|
end
|
743
749
|
|
744
750
|
it "numbers bibliographic notes and footnotes sequentially" do
|
745
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
751
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
746
752
|
#{ASCIIDOC_BLANK_HDR}
|
747
753
|
footnote:[Footnote]
|
748
754
|
|
@@ -793,7 +799,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
793
799
|
end
|
794
800
|
|
795
801
|
it "defaults section obligations" do
|
796
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
802
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
797
803
|
#{ASCIIDOC_BLANK_HDR}
|
798
804
|
|
799
805
|
== Clause
|
@@ -818,7 +824,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
818
824
|
end
|
819
825
|
|
820
826
|
it "rearranges term note, term example, term source" do
|
821
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
827
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
822
828
|
#{ASCIIDOC_BLANK_HDR}
|
823
829
|
|
824
830
|
== Terms and definitions
|
@@ -865,7 +871,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
865
871
|
end
|
866
872
|
|
867
873
|
it "extends clause levels past 5" do
|
868
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
874
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
869
875
|
#{ASCIIDOC_BLANK_HDR}
|
870
876
|
|
871
877
|
== Clause1
|
@@ -938,7 +944,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
938
944
|
# mock_iecbib_get_iec60050_103_01
|
939
945
|
# mock_iev
|
940
946
|
VCR.use_cassette "separates_iev_citations_by_top_level_clause" do
|
941
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
947
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
942
948
|
#{CACHED_ISOBIB_BLANK_HDR}
|
943
949
|
|
944
950
|
[bibliography]
|
@@ -1072,7 +1078,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
1072
1078
|
end
|
1073
1079
|
|
1074
1080
|
it "counts footnotes with link-only content as separate footnotes" do
|
1075
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
1081
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
1076
1082
|
#{ASCIIDOC_BLANK_HDR}
|
1077
1083
|
|
1078
1084
|
footnote:[http://www.example.com]
|
@@ -1107,7 +1113,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
1107
1113
|
end
|
1108
1114
|
|
1109
1115
|
it "retains AsciiMath on request" do
|
1110
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
1116
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
1111
1117
|
= Document title
|
1112
1118
|
Author
|
1113
1119
|
:docfile: test.adoc
|
@@ -1130,7 +1136,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
1130
1136
|
end
|
1131
1137
|
|
1132
1138
|
it "converts AsciiMath to MathML by default" do
|
1133
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
1139
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
1134
1140
|
= Document title
|
1135
1141
|
Author
|
1136
1142
|
:docfile: test.adoc
|
@@ -1151,7 +1157,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
1151
1157
|
end
|
1152
1158
|
|
1153
1159
|
it "cleans up text MathML" do
|
1154
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
1160
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
1155
1161
|
= Document title
|
1156
1162
|
Author
|
1157
1163
|
:docfile: test.adoc
|
@@ -1174,7 +1180,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
1174
1180
|
end
|
1175
1181
|
|
1176
1182
|
it "renumbers numeric references in Bibliography sequentially" do
|
1177
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
1183
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
1178
1184
|
#{ASCIIDOC_BLANK_HDR}
|
1179
1185
|
|
1180
1186
|
== Clause
|
@@ -1212,11 +1218,12 @@ RSpec.describe Asciidoctor::Standoc do
|
|
1212
1218
|
<docidentifier type="metanorma">[2]</docidentifier>
|
1213
1219
|
</bibitem>
|
1214
1220
|
</references></bibliography>
|
1221
|
+
</standard-document>
|
1215
1222
|
OUTPUT
|
1216
1223
|
end
|
1217
1224
|
|
1218
1225
|
it "renumbers numeric references in Bibliography subclauses sequentially" do
|
1219
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
1226
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
1220
1227
|
#{ASCIIDOC_BLANK_HDR}
|
1221
1228
|
|
1222
1229
|
== Clause
|
@@ -1290,7 +1297,7 @@ OUTPUT
|
|
1290
1297
|
end
|
1291
1298
|
|
1292
1299
|
it "inserts boilerplate before empty Normative References" do
|
1293
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
1300
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
1294
1301
|
#{ASCIIDOC_BLANK_HDR}
|
1295
1302
|
|
1296
1303
|
[bibliography]
|
@@ -1308,7 +1315,7 @@ OUTPUT
|
|
1308
1315
|
end
|
1309
1316
|
|
1310
1317
|
it "inserts boilerplate before non-empty Normative References" do
|
1311
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
1318
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
1312
1319
|
#{ASCIIDOC_BLANK_HDR}
|
1313
1320
|
|
1314
1321
|
[bibliography]
|
@@ -1332,7 +1339,7 @@ OUTPUT
|
|
1332
1339
|
end
|
1333
1340
|
|
1334
1341
|
it "inserts boilerplate before empty Normative References in French" do
|
1335
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
1342
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
1336
1343
|
= Document title
|
1337
1344
|
Author
|
1338
1345
|
:docfile: test.adoc
|