metanorma-standoc 1.6.3 → 1.7.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/rake.yml +1 -1
  3. data/lib/asciidoctor/standoc/base.rb +8 -16
  4. data/lib/asciidoctor/standoc/basicdoc.rng +50 -3
  5. data/lib/asciidoctor/standoc/cleanup.rb +1 -1
  6. data/lib/asciidoctor/standoc/cleanup_boilerplate.rb +33 -20
  7. data/lib/asciidoctor/standoc/cleanup_footnotes.rb +14 -0
  8. data/lib/asciidoctor/standoc/cleanup_inline.rb +3 -1
  9. data/lib/asciidoctor/standoc/cleanup_ref.rb +17 -24
  10. data/lib/asciidoctor/standoc/cleanup_terms.rb +4 -6
  11. data/lib/asciidoctor/standoc/converter.rb +85 -1
  12. data/lib/asciidoctor/standoc/front_contributor.rb +8 -4
  13. data/lib/asciidoctor/standoc/inline.rb +7 -5
  14. data/lib/asciidoctor/standoc/isodoc.rng +36 -3
  15. data/lib/asciidoctor/standoc/macros.rb +42 -61
  16. data/lib/asciidoctor/standoc/macros_terms.rb +82 -0
  17. data/lib/asciidoctor/standoc/ref.rb +17 -23
  18. data/lib/asciidoctor/standoc/ref_sect.rb +4 -3
  19. data/lib/asciidoctor/standoc/section.rb +21 -20
  20. data/lib/asciidoctor/standoc/table.rb +12 -0
  21. data/lib/asciidoctor/standoc/term_lookup_cleanup.rb +86 -0
  22. data/lib/asciidoctor/standoc/utils.rb +2 -0
  23. data/lib/metanorma/standoc/version.rb +1 -1
  24. data/metanorma-standoc.gemspec +5 -4
  25. data/spec/asciidoctor-standoc/base_spec.rb +10 -4
  26. data/spec/asciidoctor-standoc/blocks_spec.rb +14 -9
  27. data/spec/asciidoctor-standoc/cleanup_sections_spec.rb +37 -16
  28. data/spec/asciidoctor-standoc/cleanup_spec.rb +75 -11
  29. data/spec/asciidoctor-standoc/converter_spec.rb +21 -0
  30. data/spec/asciidoctor-standoc/inline_spec.rb +4 -5
  31. data/spec/asciidoctor-standoc/isobib_cache_spec.rb +9 -2
  32. data/spec/asciidoctor-standoc/macros_lutaml_spec.rb +5 -5
  33. data/spec/asciidoctor-standoc/macros_plantuml_spec.rb +307 -0
  34. data/spec/asciidoctor-standoc/macros_spec.rb +374 -169
  35. data/spec/asciidoctor-standoc/refs_dl_spec.rb +6 -6
  36. data/spec/asciidoctor-standoc/refs_spec.rb +100 -53
  37. data/spec/asciidoctor-standoc/section_spec.rb +17 -12
  38. data/spec/asciidoctor-standoc/table_spec.rb +146 -0
  39. data/spec/asciidoctor-standoc/validate_spec.rb +26 -0
  40. data/spec/fixtures/diagram_definitions.lutaml +22 -0
  41. data/spec/vcr_cassettes/dated_iso_ref_joint_iso_iec.yml +49 -49
  42. data/spec/vcr_cassettes/isobib_get_123.yml +13 -13
  43. data/spec/vcr_cassettes/isobib_get_123_1.yml +26 -26
  44. data/spec/vcr_cassettes/isobib_get_123_1_fr.yml +33 -33
  45. data/spec/vcr_cassettes/isobib_get_123_2001.yml +14 -14
  46. data/spec/vcr_cassettes/isobib_get_124.yml +12 -12
  47. data/spec/vcr_cassettes/rfcbib_get_rfc8341.yml +8 -8
  48. data/spec/vcr_cassettes/separates_iev_citations_by_top_level_clause.yml +286 -174
  49. metadata +31 -12
@@ -306,11 +306,11 @@ formattedref::
306
306
  <on>2014</on>
307
307
  </date>
308
308
  <date type="published">
309
- <from>2014</from>
310
- <to>2014</to>
309
+ <from>2014-04</from>
310
+ <to>2014-05</to>
311
311
  </date>
312
312
  <date type="accessed">
313
- <on>2015</on>
313
+ <on>2015-05-20</on>
314
314
  </date>
315
315
  <contributor>
316
316
  <role type="publisher"><description>Publisher role</description></role>
@@ -624,11 +624,11 @@ series.formattedref.script:: Latn
624
624
  <on>2014</on>
625
625
  </date>
626
626
  <date type="published">
627
- <from>2014</from>
628
- <to>2014</to>
627
+ <from>2014-04</from>
628
+ <to>2014-05</to>
629
629
  </date>
630
630
  <date type="accessed">
631
- <on>2015</on>
631
+ <on>2015-05-20</on>
632
632
  </date>
633
633
  <contributor>
634
634
  <role type="publisher"><description>Publisher role</description></role>
@@ -249,7 +249,7 @@ RSpec.describe Asciidoctor::Standoc do
249
249
  <docidentifier type='URN'>urn:iso:std:iso:123</docidentifier>
250
250
  <docnumber>123</docnumber>
251
251
  <date type='published'>
252
- <on>2001</on>
252
+ <on>2001-05</on>
253
253
  </date>
254
254
  <contributor>
255
255
  <role type='publisher'/>
@@ -292,7 +292,7 @@ RSpec.describe Asciidoctor::Standoc do
292
292
  <docidentifier type='URN'>urn:iso:std:iso:123:stage-90.93:ed-3:en</docidentifier>
293
293
  <docnumber>123</docnumber>
294
294
  <date type='published'>
295
- <on>2001</on>
295
+ <on>2001-05</on>
296
296
  </date>
297
297
  <contributor>
298
298
  <role type='publisher'/>
@@ -305,6 +305,13 @@ RSpec.describe Asciidoctor::Standoc do
305
305
  <edition>3</edition>
306
306
  <language>en</language>
307
307
  <script>Latn</script>
308
+ <abstract format='text/plain' language='en' script='Latn'>
309
+ This International Standard specifies procedures for sampling
310
+ natural rubber latex concentrate and for sampling syntheticrubber
311
+ latices and artificial latices. It is also suitable for sampling
312
+ rubber latex contained in drums, tank cars ortanks. The procedures
313
+ may also be used for sampling plastics dispersions.
314
+ </abstract>
308
315
  <status>
309
316
  <stage>90</stage>
310
317
  <substage>93</substage>
@@ -350,7 +357,7 @@ RSpec.describe Asciidoctor::Standoc do
350
357
  <docidentifier type='URN'>urn:iso:std:iso:123</docidentifier>
351
358
  <docnumber>123</docnumber>
352
359
  <date type='published'>
353
- <on>2001</on>
360
+ <on>2001-05</on>
354
361
  </date>
355
362
  <contributor>
356
363
  <role type='publisher'/>
@@ -393,7 +400,7 @@ RSpec.describe Asciidoctor::Standoc do
393
400
  <docidentifier type='URN'>urn:iso:std:iso:123:stage-90.93:ed-3:en</docidentifier>
394
401
  <docnumber>123</docnumber>
395
402
  <date type='published'>
396
- <on>2001</on>
403
+ <on>2001-05</on>
397
404
  </date>
398
405
  <contributor>
399
406
  <role type='publisher'/>
@@ -406,6 +413,13 @@ RSpec.describe Asciidoctor::Standoc do
406
413
  <edition>3</edition>
407
414
  <language>en</language>
408
415
  <script>Latn</script>
416
+ <abstract format='text/plain' language='en' script='Latn'>
417
+ This International Standard specifies procedures for sampling
418
+ natural rubber latex concentrate and for sampling syntheticrubber
419
+ latices and artificial latices. It is also suitable for sampling
420
+ rubber latex contained in drums, tank cars ortanks. The procedures
421
+ may also be used for sampling plastics dispersions.
422
+ </abstract>
409
423
  <status>
410
424
  <stage>90</stage>
411
425
  <substage>93</substage>
@@ -487,7 +501,7 @@ compris les éventuels amendements).
487
501
  <docidentifier type='URN'>urn:iso:std:iso:123</docidentifier>
488
502
  <docnumber>123</docnumber>
489
503
  <date type='published'>
490
- <on>2001</on>
504
+ <on>2001-05</on>
491
505
  </date>
492
506
  <contributor>
493
507
  <role type='publisher'/>
@@ -531,7 +545,7 @@ compris les éventuels amendements).
531
545
  <docidentifier type='URN'>urn:iso:std:iso:123:stage-90.93:ed-3:fr</docidentifier>
532
546
  <docnumber>123</docnumber>
533
547
  <date type='published'>
534
- <on>2001</on>
548
+ <on>2001-05</on>
535
549
  </date>
536
550
  <contributor>
537
551
  <role type='publisher'/>
@@ -545,6 +559,15 @@ compris les éventuels amendements).
545
559
  <language>en</language>
546
560
  <language>fr</language>
547
561
  <script>Latn</script>
562
+ <abstract format='text/plain' language='fr' script='Latn'>
563
+ La présente Norme internationale spécifie des méthodes
564
+ d’échantillonnage pour des concentrés de latex de
565
+ caoutchoucnaturel et pour échantillonner des latex de caoutchouc
566
+ synthétique et des latex artificiels. Elle s’applique égalementà
567
+ l’échantillonnage de latex de caoutchouc contenus dans des fûts,
568
+ citernes routières ou de stockage. Lemode opératoire peut aussi
569
+ être utilisé pour l’échantillonnage de dispersions de plastiques.
570
+ </abstract>
548
571
  <status>
549
572
  <stage>90</stage>
550
573
  <substage>93</substage>
@@ -590,7 +613,7 @@ compris les éventuels amendements).
590
613
  <docidentifier type='URN'>urn:iso:std:iso:123</docidentifier>
591
614
  <docnumber>123</docnumber>
592
615
  <date type='published'>
593
- <on>2001</on>
616
+ <on>2001-05</on>
594
617
  </date>
595
618
  <contributor>
596
619
  <role type='publisher'/>
@@ -634,7 +657,7 @@ compris les éventuels amendements).
634
657
  <docidentifier type='URN'>urn:iso:std:iso:123:stage-90.93:ed-3:fr</docidentifier>
635
658
  <docnumber>123</docnumber>
636
659
  <date type='published'>
637
- <on>2001</on>
660
+ <on>2001-05</on>
638
661
  </date>
639
662
  <contributor>
640
663
  <role type='publisher'/>
@@ -648,6 +671,15 @@ compris les éventuels amendements).
648
671
  <language>en</language>
649
672
  <language>fr</language>
650
673
  <script>Latn</script>
674
+ <abstract format='text/plain' language='fr' script='Latn'>
675
+ La présente Norme internationale spécifie des méthodes
676
+ d’échantillonnage pour des concentrés de latex de
677
+ caoutchoucnaturel et pour échantillonner des latex de caoutchouc
678
+ synthétique et des latex artificiels. Elle s’applique égalementà
679
+ l’échantillonnage de latex de caoutchouc contenus dans des fûts,
680
+ citernes routières ou de stockage. Lemode opératoire peut aussi
681
+ être utilisé pour l’échantillonnage de dispersions de plastiques.
682
+ </abstract>
651
683
  <status>
652
684
  <stage>90</stage>
653
685
  <substage>93</substage>
@@ -761,7 +793,7 @@ compris les éventuels amendements).
761
793
  <docidentifier type='URN'>urn:iso:std:iso-iec:tr:12382:stage-90.93:ed-2:en</docidentifier>
762
794
  <docnumber>12382</docnumber>
763
795
  <date type="published">
764
- <on>1992</on>
796
+ <on>1992-12</on>
765
797
  </date>
766
798
  <contributor>
767
799
  <role type="publisher"/>
@@ -809,7 +841,7 @@ compris les éventuels amendements).
809
841
  <docidentifier type='URN'>urn:iso:std:iso:124:stage-90.93:ed-7:en</docidentifier>
810
842
  <docnumber>124</docnumber>
811
843
  <date type="published">
812
- <on>2014</on>
844
+ <on>2014-03</on>
813
845
  </date>
814
846
  <contributor>
815
847
  <role type="publisher"/>
@@ -854,7 +886,7 @@ compris les éventuels amendements).
854
886
  <docidentifier type='URN'>urn:iso:std:iso-iec:tr:12382:stage-90.93:ed-2:en</docidentifier>
855
887
  <docnumber>12382</docnumber>
856
888
  <date type="published">
857
- <on>1992</on>
889
+ <on>1992-12</on>
858
890
  </date>
859
891
  <contributor>
860
892
  <role type="publisher"/>
@@ -903,7 +935,7 @@ compris les éventuels amendements).
903
935
  <docidentifier type='URN'>urn:iso:std:iso:124:stage-90.93:ed-7:en</docidentifier>
904
936
  <docnumber>124</docnumber>
905
937
  <date type="published">
906
- <on>2014</on>
938
+ <on>2014-03</on>
907
939
  </date>
908
940
  <contributor>
909
941
  <role type="publisher"/>
@@ -978,7 +1010,7 @@ compris les éventuels amendements).
978
1010
  <docidentifier type='URN'>urn:iso:std:iso:124:stage-90.93:ed-7:en</docidentifier>
979
1011
  <docnumber>124</docnumber>
980
1012
  <date type='published'>
981
- <on>2014</on>
1013
+ <on>2014-03</on>
982
1014
  </date>
983
1015
  <contributor>
984
1016
  <role type='publisher'/>
@@ -1461,53 +1493,68 @@ OUTPUT
1461
1493
  == Scope
1462
1494
 
1463
1495
  <<iso123>>
1464
-
1465
1496
  <<iso123,clause=1>>
1497
+ <<iso124>>
1498
+ <<iso124,clause=1>>
1466
1499
 
1467
1500
  [bibliography]
1468
1501
  == Normative References
1469
1502
 
1470
- * [[[iso123,repo:(a/b,ISO 123)]]] _Standard_
1503
+ * [[[iso123,repo:(ab/ISO 123)]]] _Standard_
1504
+ * [[[iso124,repo:(ab/ISO 124,id)]]] _Standard_
1471
1505
  INPUT
1472
1506
  #{BLANK_HDR}
1473
- <sections>
1474
- <clause id='_' inline-header='false' obligation='normative' type="scope">
1475
- <title>Scope</title>
1476
- <p id='_'>
1477
- <eref type='inline' bibitemid='iso123' citeas='ISO 123'/>
1478
- </p>
1479
- <p id='_'>
1480
- <eref type='inline' bibitemid='iso123' citeas='ISO 123'>
1481
- <localityStack>
1482
- <locality type='clause'>
1483
- <referenceFrom>1</referenceFrom>
1484
- </locality>
1485
- </localityStack>
1486
- </eref>
1487
- </p>
1488
- </clause>
1489
- </sections>
1490
- <bibliography>
1491
- <references id='_' normative='true' obligation='informative'>
1492
- <title>Normative references</title>
1493
- <p id='_'>
1494
- The following documents are referred to in the text in such a way that
1495
- some or all of their content constitutes requirements of this document.
1496
- For dated references, only the edition cited applies. For undated
1497
- references, the latest edition of the referenced document (including any
1498
- amendments) applies.
1499
- </p>
1500
- <bibitem id='iso123'>
1501
- <formattedref format='application/x-isodoc+xml'>
1502
- <em>Standard</em>
1503
- </formattedref>
1504
- <docidentifier type="ISO">ISO 123</docidentifier>
1505
- <docidentifier type="repository">a/b</docidentifier>
1506
- <docnumber>123</docnumber>
1507
- </bibitem>
1508
- </references>
1509
- </bibliography>
1510
- </standard-document>
1507
+ <sections>
1508
+ <clause id='_' type='scope' inline-header='false' obligation='normative'>
1509
+ <title>Scope</title>
1510
+ <p id='_'>
1511
+ <eref type='inline' bibitemid='iso123' citeas='ISO 123'/>
1512
+ <eref type='inline' bibitemid='iso123' citeas='ISO 123'>
1513
+ <localityStack>
1514
+ <locality type='clause'>
1515
+ <referenceFrom>1</referenceFrom>
1516
+ </locality>
1517
+ </localityStack>
1518
+ </eref>
1519
+ <eref type='inline' bibitemid='iso124' citeas='id'/>
1520
+ <eref type='inline' bibitemid='iso124' citeas='id'>
1521
+ <localityStack>
1522
+ <locality type='clause'>
1523
+ <referenceFrom>1</referenceFrom>
1524
+ </locality>
1525
+ </localityStack>
1526
+ </eref>
1527
+ </p>
1528
+ </clause>
1529
+ </sections>
1530
+ <bibliography>
1531
+ <references id='_' normative='true' obligation='informative'>
1532
+ <title>Normative references</title>
1533
+ <p id='_'>
1534
+ The following documents are referred to in the text in such a way that
1535
+ some or all of their content constitutes requirements of this document.
1536
+ For dated references, only the edition cited applies. For undated
1537
+ references, the latest edition of the referenced document (including any
1538
+ amendments) applies.
1539
+ </p>
1540
+ <bibitem id='iso123'>
1541
+ <formattedref format='application/x-isodoc+xml'>
1542
+ <em>Standard</em>
1543
+ </formattedref>
1544
+ <docidentifier type='ISO'>ISO 123</docidentifier>
1545
+ <docidentifier type='repository'>ab/ISO 123</docidentifier>
1546
+ <docnumber>123</docnumber>
1547
+ </bibitem>
1548
+ <bibitem id='iso124'>
1549
+ <formattedref format='application/x-isodoc+xml'>
1550
+ <em>Standard</em>
1551
+ </formattedref>
1552
+ <docidentifier>id</docidentifier>
1553
+ <docidentifier type='repository'>ab/ISO 124</docidentifier>
1554
+ </bibitem>
1555
+ </references>
1556
+ </bibliography>
1557
+ </standard-document>
1511
1558
  OUTPUT
1512
1559
  end
1513
1560
 
@@ -34,6 +34,11 @@ RSpec.describe Asciidoctor::Standoc do
34
34
 
35
35
  == Terms, Definitions, Symbols and Abbreviated Terms
36
36
 
37
+ [.boilerplate]
38
+ === Boilerplate
39
+
40
+ Boilerplate text
41
+
37
42
  [.nonterm]
38
43
  === Introduction
39
44
 
@@ -111,12 +116,12 @@ RSpec.describe Asciidoctor::Standoc do
111
116
  <title>Terms and definitions</title>
112
117
  <p id="_">For the purposes of this document,
113
118
  the following terms and definitions apply.</p>
114
- <term id="_">
119
+ <term id="term-term1">
115
120
  <preferred>Term1</preferred>
116
121
  </term>
117
122
  </terms>
118
123
  <clause id="_" obligation="normative"><title>Terms, definitions, symbols and abbreviated terms</title>
119
- <p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
124
+ <p id='_'>Boilerplate text</p>
120
125
  <clause id="_" inline-header="false" obligation="normative">
121
126
  <title>Introduction</title>
122
127
  <clause id="_" inline-header="false" obligation="normative">
@@ -133,14 +138,14 @@ RSpec.describe Asciidoctor::Standoc do
133
138
  <title>Intro 4</title>
134
139
  <terms id="_" obligation="normative">
135
140
  <title>Intro 5</title>
136
- <term id="_">
141
+ <term id="term-term1-1">
137
142
  <preferred>Term1</preferred>
138
143
  </term>
139
144
  </terms>
140
145
  </clause>
141
146
  <terms id="_" obligation="normative">
142
147
  <title>Normal Terms</title>
143
- <term id="_">
148
+ <term id="term-term2">
144
149
  <preferred>Term2</preferred>
145
150
  </term>
146
151
  </terms>
@@ -317,7 +322,7 @@ RSpec.describe Asciidoctor::Standoc do
317
322
  <title>Terms and definitions</title>
318
323
  <p id="_">For the purposes of this document,
319
324
  the following terms and definitions apply.</p>
320
- <term id="_" language="en" script="Latn">
325
+ <term id="term-term1" language="en" script="Latn">
321
326
  <preferred>Term1</preferred>
322
327
  </term>
323
328
  </terms>
@@ -339,14 +344,14 @@ RSpec.describe Asciidoctor::Standoc do
339
344
  <title>Intro 4</title>
340
345
  <terms id="_" language="en" script="Latn" obligation="normative">
341
346
  <title>Intro 5</title>
342
- <term id="_">
347
+ <term id="term-term1-1">
343
348
  <preferred>Term1</preferred>
344
349
  </term>
345
350
  </terms>
346
351
  </clause>
347
352
  <terms id="_" language="en" script="Latn" obligation="normative">
348
353
  <title>Normal Terms</title>
349
- <term id="_">
354
+ <term id="term-term2">
350
355
  <preferred>Term2</preferred>
351
356
  </term>
352
357
  </terms>
@@ -468,7 +473,7 @@ RSpec.describe Asciidoctor::Standoc do
468
473
  <terms id='_' obligation='normative'>
469
474
  <title>Terms and definitions</title>
470
475
  <p id="_">For the purposes of this document, the following terms and definitions apply.</p>
471
- <term id='_'>
476
+ <term id='term-term1'>
472
477
  <preferred>Term1</preferred>
473
478
  </term>
474
479
  </terms>
@@ -477,7 +482,7 @@ RSpec.describe Asciidoctor::Standoc do
477
482
  <p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
478
483
  <terms id='_' obligation='normative'>
479
484
  <title>Normal Terms</title>
480
- <term id='_'>
485
+ <term id='term-term2'>
481
486
  <preferred>Term2</preferred>
482
487
  </term>
483
488
  </terms>
@@ -536,7 +541,7 @@ RSpec.describe Asciidoctor::Standoc do
536
541
  <terms id='_' obligation='normative'>
537
542
  <title>Terms, definitions and symbols</title>
538
543
  <p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
539
- <term id='_'>
544
+ <term id='term-term'>
540
545
  <preferred>Term</preferred>
541
546
  </term>
542
547
  <definitions id='_' obligation="normative" type="symbols">
@@ -565,7 +570,7 @@ RSpec.describe Asciidoctor::Standoc do
565
570
  <terms id='_' obligation='normative'>
566
571
  <title>Terms, definitions and abbreviated terms</title>
567
572
  <p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
568
- <term id='_'>
573
+ <term id='term-term'>
569
574
  <preferred>Term</preferred>
570
575
  </term>
571
576
  <definitions id='_' obligation="normative" type="abbreviated_terms">
@@ -710,7 +715,7 @@ RSpec.describe Asciidoctor::Standoc do
710
715
  <terms id="_" obligation="normative">
711
716
  <title>Terms and definitions</title><p id="_">For the purposes of this document, the terms and definitions
712
717
  given in <eref bibitemid="iso1234"/> and <eref bibitemid="iso5678"/> and the following apply.</p>
713
- <term id="_">
718
+ <term id="term-term1">
714
719
  <preferred>Term1</preferred>
715
720
  </term>
716
721
  </terms></sections>
@@ -35,6 +35,152 @@ RSpec.describe Asciidoctor::Standoc do
35
35
  OUTPUT
36
36
  end
37
37
 
38
+ it "processes table widths" do
39
+ expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
40
+ #{ASCIIDOC_BLANK_HDR}
41
+ [width=75%]
42
+ |===
43
+ |A
44
+ |B
45
+ |===
46
+
47
+ [width=75]
48
+ |===
49
+ |A
50
+ |B
51
+ |===
52
+
53
+ [width=575]
54
+ |===
55
+ |A
56
+ |B
57
+ |===
58
+
59
+ INPUT
60
+ #{BLANK_HDR}
61
+ <sections>
62
+ <table id='_' width='75%'>
63
+ <tbody>
64
+ <tr>
65
+ <td valign='top' align='left'>A</td>
66
+ </tr>
67
+ <tr>
68
+ <td valign='top' align='left'>B</td>
69
+ </tr>
70
+ </tbody>
71
+ </table>
72
+ <table id='_' width='75'>
73
+ <tbody>
74
+ <tr>
75
+ <td valign='top' align='left'>A</td>
76
+ </tr>
77
+ <tr>
78
+ <td valign='top' align='left'>B</td>
79
+ </tr>
80
+ </tbody>
81
+ </table>
82
+ <table id='_' width='575'>
83
+ <tbody>
84
+ <tr>
85
+ <td valign='top' align='left'>A</td>
86
+ </tr>
87
+ <tr>
88
+ <td valign='top' align='left'>B</td>
89
+ </tr>
90
+ </tbody>
91
+ </table>
92
+ </sections>
93
+ </standard-document>
94
+
95
+ OUTPUT
96
+ end
97
+
98
+ it "processes column widths in tables" do
99
+ expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
100
+ #{ASCIIDOC_BLANK_HDR}
101
+ [cols=".<,.^,^.>"]
102
+ |===
103
+ |A |B |C
104
+
105
+ |1 |2 |3
106
+ |===
107
+
108
+ [cols="3"]
109
+ |===
110
+ |A |B |C
111
+
112
+ |1 |2 |3
113
+ |===
114
+
115
+
116
+ [cols="1,2,6"]
117
+ |===
118
+ |A |B |C
119
+
120
+ |1 |2 |3
121
+ |===
122
+ INPUT
123
+ #{BLANK_HDR}
124
+ <sections>
125
+ <table id='_'>
126
+ <thead>
127
+ <tr>
128
+ <th valign='top' align='left'>A</th>
129
+ <th valign='middle' align='left'>B</th>
130
+ <th valign='bottom' align='center'>C</th>
131
+ </tr>
132
+ </thead>
133
+ <tbody>
134
+ <tr>
135
+ <td valign='top' align='left'>1</td>
136
+ <td valign='middle' align='left'>2</td>
137
+ <td valign='bottom' align='center'>3</td>
138
+ </tr>
139
+ </tbody>
140
+ </table>
141
+ <table id='_'>
142
+ <thead>
143
+ <tr>
144
+ <th valign='top' align='left'>A</th>
145
+ <th valign='top' align='left'>B</th>
146
+ <th valign='top' align='left'>C</th>
147
+ </tr>
148
+ </thead>
149
+ <tbody>
150
+ <tr>
151
+ <td valign='top' align='left'>1</td>
152
+ <td valign='top' align='left'>2</td>
153
+ <td valign='top' align='left'>3</td>
154
+ </tr>
155
+ </tbody>
156
+ </table>
157
+ <table id='_'>
158
+ <colgroup>
159
+ <col width='11.1111%'/>
160
+ <col width='22.2222%'/>
161
+ <col width='66.6667%'/>
162
+ </colgroup>
163
+ <thead>
164
+ <tr>
165
+ <th valign='top' align='left'>A</th>
166
+ <th valign='top' align='left'>B</th>
167
+ <th valign='top' align='left'>C</th>
168
+ </tr>
169
+ </thead>
170
+ <tbody>
171
+ <tr>
172
+ <td valign='top' align='left'>1</td>
173
+ <td valign='top' align='left'>2</td>
174
+ <td valign='top' align='left'>3</td>
175
+ </tr>
176
+ </tbody>
177
+ </table>
178
+ </sections>
179
+ </standard-document>
180
+ OUTPUT
181
+ end
182
+
183
+
38
184
  it "inserts header rows in a table with a name and no header" do
39
185
  expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
40
186
  #{ASCIIDOC_BLANK_HDR}