isodoc 1.0.24 → 1.0.29
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/macos.yml +14 -4
- data/.github/workflows/ubuntu.yml +19 -5
- data/.github/workflows/windows.yml +14 -4
- data/isodoc.gemspec +1 -1
- data/lib/isodoc-yaml/i18n-en.yaml +3 -1
- data/lib/isodoc-yaml/i18n-fr.yaml +3 -1
- data/lib/isodoc-yaml/i18n-zh-Hans.yaml +3 -1
- data/lib/isodoc/convert.rb +1 -0
- data/lib/isodoc/function/blocks.rb +43 -49
- data/lib/isodoc/function/{blocks_example.rb → blocks_example_note.rb} +57 -2
- data/lib/isodoc/function/cleanup.rb +16 -2
- data/lib/isodoc/function/i18n.rb +1 -0
- data/lib/isodoc/function/inline.rb +79 -77
- data/lib/isodoc/function/inline_simple.rb +72 -0
- data/lib/isodoc/function/lists.rb +12 -6
- data/lib/isodoc/function/references.rb +51 -39
- data/lib/isodoc/function/reqt.rb +13 -4
- data/lib/isodoc/function/section.rb +19 -8
- data/lib/isodoc/function/table.rb +3 -4
- data/lib/isodoc/function/terms.rb +1 -1
- data/lib/isodoc/function/to_word_html.rb +23 -13
- data/lib/isodoc/function/utils.rb +13 -6
- data/lib/isodoc/function/xref_counter.rb +43 -9
- data/lib/isodoc/function/xref_gen.rb +2 -1
- data/lib/isodoc/function/xref_gen_seq.rb +11 -10
- data/lib/isodoc/function/xref_sect_gen.rb +24 -24
- data/lib/isodoc/headlesshtml_convert.rb +5 -0
- data/lib/isodoc/html_convert.rb +5 -0
- data/lib/isodoc/html_function/footnotes.rb +3 -3
- data/lib/isodoc/html_function/html.rb +16 -1
- data/lib/isodoc/html_function/postprocess.rb +6 -5
- data/lib/isodoc/metadata.rb +10 -3
- data/lib/isodoc/metadata_date.rb +19 -7
- data/lib/isodoc/pdf_convert.rb +5 -0
- data/lib/isodoc/version.rb +1 -1
- data/lib/isodoc/word_convert.rb +5 -0
- data/lib/isodoc/word_function/body.rb +13 -51
- data/lib/isodoc/word_function/footnotes.rb +3 -3
- data/lib/isodoc/word_function/inline.rb +75 -0
- data/lib/isodoc/word_function/postprocess.rb +13 -2
- data/lib/isodoc/word_function/table.rb +3 -3
- data/lib/isodoc/xslfo_convert.rb +5 -0
- data/spec/assets/i18n.yaml +4 -1
- data/spec/assets/odf.emf +0 -0
- data/spec/assets/odf.svg +4 -0
- data/spec/assets/odf1.svg +4 -0
- data/spec/isodoc/blocks_spec.rb +274 -51
- data/spec/isodoc/cleanup_spec.rb +317 -25
- data/spec/isodoc/footnotes_spec.rb +20 -5
- data/spec/isodoc/i18n_spec.rb +12 -12
- data/spec/isodoc/inline_spec.rb +299 -4
- data/spec/isodoc/lists_spec.rb +8 -8
- data/spec/isodoc/metadata_spec.rb +112 -3
- data/spec/isodoc/postproc_spec.rb +39 -21
- data/spec/isodoc/ref_spec.rb +121 -52
- data/spec/isodoc/section_spec.rb +236 -207
- data/spec/isodoc/table_spec.rb +28 -28
- data/spec/isodoc/terms_spec.rb +57 -13
- data/spec/isodoc/xref_spec.rb +218 -71
- metadata +10 -5
data/spec/isodoc/i18n_spec.rb
CHANGED
@@ -21,7 +21,7 @@ RSpec.describe IsoDoc do
|
|
21
21
|
<p id="E">Text</p>
|
22
22
|
</clause>
|
23
23
|
|
24
|
-
<clause id="H" obligation="normative"><title>Terms,
|
24
|
+
<clause id="H" obligation="normative"><title>Terms, definitions, symbols and abbreviated terms</title><terms id="I" obligation="normative">
|
25
25
|
<title>Normal Terms</title>
|
26
26
|
<term id="J">
|
27
27
|
<preferred>Term2</preferred>
|
@@ -55,11 +55,11 @@ RSpec.describe IsoDoc do
|
|
55
55
|
<title>Annex A.1a</title>
|
56
56
|
</clause>
|
57
57
|
</clause>
|
58
|
-
</annex><bibliography><references id="R" obligation="informative">
|
58
|
+
</annex><bibliography><references id="R" obligation="informative" normative="true">
|
59
59
|
<title>Normative References</title>
|
60
60
|
</references><clause id="S" obligation="informative">
|
61
61
|
<title>Bibliography</title>
|
62
|
-
<references id="T" obligation="informative">
|
62
|
+
<references id="T" obligation="informative" normative="false">
|
63
63
|
<title>Bibliography Subsection</title>
|
64
64
|
</references>
|
65
65
|
</clause>
|
@@ -157,7 +157,7 @@ RSpec.describe IsoDoc do
|
|
157
157
|
<p id="E">Text</p>
|
158
158
|
</clause>
|
159
159
|
|
160
|
-
<clause id="H" obligation="normative"><title>Terms,
|
160
|
+
<clause id="H" obligation="normative"><title>Terms, definitions, symbols and abbreviated terms</title><terms id="I" obligation="normative">
|
161
161
|
<title>Normal Terms</title>
|
162
162
|
<term id="J">
|
163
163
|
<preferred>Term2</preferred>
|
@@ -191,11 +191,11 @@ RSpec.describe IsoDoc do
|
|
191
191
|
<title>Annex A.1a</title>
|
192
192
|
</clause>
|
193
193
|
</clause>
|
194
|
-
</annex><bibliography><references id="R" obligation="informative">
|
194
|
+
</annex><bibliography><references id="R" obligation="informative" normative="true">
|
195
195
|
<title>Normative References</title>
|
196
196
|
</references><clause id="S" obligation="informative">
|
197
197
|
<title>Bibliography</title>
|
198
|
-
<references id="T" obligation="informative">
|
198
|
+
<references id="T" obligation="informative" normative="false">
|
199
199
|
<title>Bibliography Subsection</title>
|
200
200
|
</references>
|
201
201
|
</clause>
|
@@ -293,7 +293,7 @@ RSpec.describe IsoDoc do
|
|
293
293
|
<p id="E">Text</p>
|
294
294
|
</clause>
|
295
295
|
|
296
|
-
<clause id="H" obligation="normative"><title>Terms,
|
296
|
+
<clause id="H" obligation="normative"><title>Terms, definitions, symbols and abbreviated terms</title><terms id="I" obligation="normative">
|
297
297
|
<title>Normal Terms</title>
|
298
298
|
<term id="J">
|
299
299
|
<preferred>Term2</preferred>
|
@@ -327,11 +327,11 @@ RSpec.describe IsoDoc do
|
|
327
327
|
<title>Annex A.1a</title>
|
328
328
|
</clause>
|
329
329
|
</clause>
|
330
|
-
</annex><bibliography><references id="R" obligation="informative">
|
330
|
+
</annex><bibliography><references id="R" obligation="informative" normative="true">
|
331
331
|
<title>Normative References</title>
|
332
332
|
</references><clause id="S" obligation="informative">
|
333
333
|
<title>Bibliography</title>
|
334
|
-
<references id="T" obligation="informative">
|
334
|
+
<references id="T" obligation="informative" normative="false">
|
335
335
|
<title>Bibliography Subsection</title>
|
336
336
|
</references>
|
337
337
|
</clause>
|
@@ -430,7 +430,7 @@ RSpec.describe IsoDoc do
|
|
430
430
|
<p id="E"><eref type="inline" bibitemid="ISO712"><locality type="table"><referenceFrom>1</referenceFrom><referenceTo>1</referenceTo></locality></eref></p>
|
431
431
|
</clause>
|
432
432
|
|
433
|
-
<clause id="H" obligation="normative"><title>Terms,
|
433
|
+
<clause id="H" obligation="normative"><title>Terms, definitions, symbols and abbreviated terms</title><terms id="I" obligation="normative">
|
434
434
|
<title>Normal Terms</title>
|
435
435
|
<term id="J">
|
436
436
|
<preferred>Term2</preferred>
|
@@ -464,7 +464,7 @@ RSpec.describe IsoDoc do
|
|
464
464
|
<title>Annex A.1a</title>
|
465
465
|
</clause>
|
466
466
|
</clause>
|
467
|
-
</annex><bibliography><references id="R" obligation="informative">
|
467
|
+
</annex><bibliography><references id="R" obligation="informative" normative="true">
|
468
468
|
<title>Normative References</title>
|
469
469
|
<bibitem id="ISO712" type="standard">
|
470
470
|
<title format="text/plain">Cereals and cereal products</title>
|
@@ -478,7 +478,7 @@ RSpec.describe IsoDoc do
|
|
478
478
|
</bibitem>
|
479
479
|
</references><clause id="S" obligation="informative">
|
480
480
|
<title>Bibliography</title>
|
481
|
-
<references id="T" obligation="informative">
|
481
|
+
<references id="T" obligation="informative" normative="false">
|
482
482
|
<title>Bibliography Subsection</title>
|
483
483
|
</references>
|
484
484
|
</clause>
|
data/spec/isodoc/inline_spec.rb
CHANGED
@@ -165,7 +165,7 @@ RSpec.describe IsoDoc do
|
|
165
165
|
<sections>
|
166
166
|
<clause id="clause1"><title>Clause 1</title></clause>
|
167
167
|
</sections>
|
168
|
-
<bibliography><references id="_normative_references" obligation="informative"><title>Normative References</title>
|
168
|
+
<bibliography><references id="_normative_references" obligation="informative" normative="true"><title>Normative References</title>
|
169
169
|
<p>The following documents are referred to in the text in such a way that some or all of their content constitutes requirements of this document. For dated references, only the edition cited applies. For undated references, the latest edition of the referenced document (including any amendments) applies.</p>
|
170
170
|
<bibitem id="ISO712" type="standard">
|
171
171
|
<title format="text/plain">Cereals or cereal products</title>
|
@@ -414,7 +414,7 @@ OUTPUT
|
|
414
414
|
<eref type="inline" bibitemid="ISO712" citeas="ISO 712">A</stem>
|
415
415
|
</p>
|
416
416
|
</foreword></preface>
|
417
|
-
<bibliography><references id="_normative_references" obligation="informative"><title>Normative References</title>
|
417
|
+
<bibliography><references id="_normative_references" obligation="informative" normative="true"><title>Normative References</title>
|
418
418
|
<bibitem id="ISO712" type="standard">
|
419
419
|
<title format="text/plain">Cereals and cereal products</title>
|
420
420
|
<docidentifier>ISO 712</docidentifier>
|
@@ -467,9 +467,11 @@ OUTPUT
|
|
467
467
|
<eref type="inline" bibitemid="ISO712"><locality type="whole"></locality></eref>
|
468
468
|
<eref type="inline" bibitemid="ISO712"><locality type="locality:prelude"><referenceFrom>7</referenceFrom></locality></eref>
|
469
469
|
<eref type="inline" bibitemid="ISO712" citeas="ISO 712">A</eref>
|
470
|
+
<eref type="inline" bibitemid="ISO712"><locality type="anchor"><referenceFrom>1</referenceFrom></locality></eref>
|
471
|
+
<eref type="inline" bibitemid="ISO712"><locality type="anchor"><referenceFrom>1</referenceFrom></locality><locality type="clause"><referenceFrom>1</referenceFrom></locality></eref>
|
470
472
|
</p>
|
471
473
|
</foreword></preface>
|
472
|
-
<bibliography><references id="_normative_references" obligation="informative"><title>Normative References</title>
|
474
|
+
<bibliography><references id="_normative_references" obligation="informative" normative="true"><title>Normative References</title>
|
473
475
|
<bibitem id="ISO712" type="standard">
|
474
476
|
<title format="text/plain">Cereals and cereal products</title>
|
475
477
|
<docidentifier>ISO 712</docidentifier>
|
@@ -499,9 +501,11 @@ OUTPUT
|
|
499
501
|
<a href="#ISO712">ISO 712, Clause 1</a>
|
500
502
|
<a href="#ISO712">ISO 712, Clause 1.5</a>
|
501
503
|
<a href="#ISO712">A</a>
|
502
|
-
<a href="#ISO712">ISO 712, </a>
|
504
|
+
<a href="#ISO712">ISO 712, Whole of text</a>
|
503
505
|
<a href="#ISO712">ISO 712, Prelude 7</a>
|
504
506
|
<a href="#ISO712">A</a>
|
507
|
+
<a href='#ISO712'>ISO 712</a>
|
508
|
+
<a href='#ISO712'>ISO 712, Clause 1</a>
|
505
509
|
</p>
|
506
510
|
</div>
|
507
511
|
<p class="zzSTDTitle1"/>
|
@@ -515,5 +519,296 @@ OUTPUT
|
|
515
519
|
OUTPUT
|
516
520
|
end
|
517
521
|
|
522
|
+
it "processes eref content pointing to reference with citation URL" do
|
523
|
+
expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
524
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
525
|
+
<preface><foreword>
|
526
|
+
<p>
|
527
|
+
<eref type="inline" bibitemid="ISO712" citeas="ISO 712"/>
|
528
|
+
<eref type="inline" bibitemid="ISO712"/>
|
529
|
+
<eref type="inline" bibitemid="ISO713"><locality type="table"><referenceFrom>1</referenceFrom></locality></eref>
|
530
|
+
<eref type="inline" bibitemid="ISO713"><localityStack><locality type="table"><referenceFrom>1</referenceFrom></locality></localityStack></eref>
|
531
|
+
<eref type="inline" bibitemid="ISO713"><localityStack><locality type="table"><referenceFrom>1</referenceFrom></locality></localityStack><localityStack><locality type="clause"><referenceFrom>1</referenceFrom></locality></localityStack></eref>
|
532
|
+
<eref type="inline" bibitemid="ISO713"><locality type="table"><referenceFrom>1</referenceFrom><referenceTo>1</referenceTo></locality></eref>
|
533
|
+
<eref type="inline" bibitemid="ISO713"><locality type="clause"><referenceFrom>1</referenceFrom></locality><locality type="table"><referenceFrom>1</referenceFrom></locality></eref>
|
534
|
+
<eref type="inline" bibitemid="ISO713"><locality type="clause"><referenceFrom>1</referenceFrom></locality></eref>
|
535
|
+
<eref type="inline" bibitemid="ISO713"><locality type="clause"><referenceFrom>1.5</referenceFrom></locality></eref>
|
536
|
+
<eref type="inline" bibitemid="ISO713"><locality type="table"><referenceFrom>1</referenceFrom></locality>A</eref>
|
537
|
+
<eref type="inline" bibitemid="ISO713"><locality type="whole"></locality></eref>
|
538
|
+
<eref type="inline" bibitemid="ISO713"><locality type="locality:prelude"><referenceFrom>7</referenceFrom></locality></eref>
|
539
|
+
<eref type="inline" bibitemid="ISO713" citeas="ISO 713">A</eref>
|
540
|
+
<eref type="inline" bibitemid="ISO713"><locality type="anchor"><referenceFrom>xyz</referenceFrom></locality></eref>
|
541
|
+
<eref type="inline" bibitemid="ISO713"><locality type="anchor"><referenceFrom>xyz</referenceFrom></locality><locality type="clause"><referenceFrom>1</referenceFrom></locality></eref>
|
542
|
+
</p>
|
543
|
+
</foreword></preface>
|
544
|
+
<bibliography><references id="_normative_references" obligation="informative" normative="true"><title>Normative References</title>
|
545
|
+
<bibitem id="ISO712" type="standard">
|
546
|
+
<title format="text/plain">Cereals and cereal products</title>
|
547
|
+
<uri type="citation">http://www.example.com</uri>
|
548
|
+
<docidentifier>ISO 712</docidentifier>
|
549
|
+
<contributor>
|
550
|
+
<role type="publisher"/>
|
551
|
+
<organization>
|
552
|
+
<abbreviation>ISO</abbreviation>
|
553
|
+
</organization>
|
554
|
+
</contributor>
|
555
|
+
</bibitem>
|
556
|
+
<bibitem id="ISO713" type="standard">
|
557
|
+
<title format="text/plain">Cereals and cereal products</title>
|
558
|
+
<uri type="citation">spec/assets/iso713</uri>
|
559
|
+
<docidentifier>ISO 713</docidentifier>
|
560
|
+
<contributor>
|
561
|
+
<role type="publisher"/>
|
562
|
+
<organization>
|
563
|
+
<abbreviation>ISO</abbreviation>
|
564
|
+
</organization>
|
565
|
+
</contributor>
|
566
|
+
</bibitem>
|
567
|
+
</references>
|
568
|
+
</bibliography>
|
569
|
+
</iso-standard>
|
570
|
+
INPUT
|
571
|
+
#{HTML_HDR}
|
572
|
+
<br/>
|
573
|
+
<div>
|
574
|
+
<h1 class='ForewordTitle'>Foreword</h1>
|
575
|
+
<p>
|
576
|
+
<a href='http://www.example.com'>ISO 712</a>
|
577
|
+
<a href='http://www.example.com'>ISO 712</a>
|
578
|
+
<a href='spec/assets/iso713.html'>ISO 713, Table 1</a>
|
579
|
+
<a href='spec/assets/iso713.html'>ISO 713, Table 1</a>
|
580
|
+
<a href='spec/assets/iso713.html'>ISO 713, Table 1; Clause 1</a>
|
581
|
+
<a href='spec/assets/iso713.html'>ISO 713, Table 1–1</a>
|
582
|
+
<a href='spec/assets/iso713.html'>ISO 713, Clause 1, Table 1</a>
|
583
|
+
<a href='spec/assets/iso713.html'>ISO 713, Clause 1</a>
|
584
|
+
<a href='spec/assets/iso713.html'>ISO 713, Clause 1.5</a>
|
585
|
+
<a href='spec/assets/iso713.html'>A</a>
|
586
|
+
<a href='spec/assets/iso713.html'>ISO 713, Whole of text</a>
|
587
|
+
<a href='spec/assets/iso713.html'>ISO 713, Prelude 7</a>
|
588
|
+
<a href='spec/assets/iso713.html'>A</a>
|
589
|
+
<a href='spec/assets/iso713.html#xyz'>ISO 713</a>
|
590
|
+
<a href='spec/assets/iso713.html#xyz'>ISO 713, Clause 1</a>
|
591
|
+
</p>
|
592
|
+
</div>
|
593
|
+
<p class='zzSTDTitle1'/>
|
594
|
+
<div>
|
595
|
+
<h1>1.  Normative references</h1>
|
596
|
+
<p id='ISO712' class='NormRef'>
|
597
|
+
ISO 712,
|
598
|
+
<i>Cereals and cereal products</i>
|
599
|
+
</p>
|
600
|
+
<p id='ISO713' class='NormRef'>
|
601
|
+
ISO 713,
|
602
|
+
<i>Cereals and cereal products</i>
|
603
|
+
</p>
|
604
|
+
</div>
|
605
|
+
</div>
|
606
|
+
</body>
|
607
|
+
</html>
|
608
|
+
OUTPUT
|
609
|
+
end
|
610
|
+
|
611
|
+
it "processes eref content pointing to reference with citation URL (Word)" do
|
612
|
+
expect(xmlpp(IsoDoc::WordConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
613
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
614
|
+
<preface><foreword>
|
615
|
+
<p>
|
616
|
+
<eref type="inline" bibitemid="ISO712" citeas="ISO 712"/>
|
617
|
+
<eref type="inline" bibitemid="ISO712"/>
|
618
|
+
<eref type="inline" bibitemid="ISO713"><locality type="table"><referenceFrom>1</referenceFrom></locality></eref>
|
619
|
+
<eref type="inline" bibitemid="ISO713"><localityStack><locality type="table"><referenceFrom>1</referenceFrom></locality></localityStack></eref>
|
620
|
+
<eref type="inline" bibitemid="ISO713"><localityStack><locality type="table"><referenceFrom>1</referenceFrom></locality></localityStack><localityStack><locality type="clause"><referenceFrom>1</referenceFrom></locality></localityStack></eref>
|
621
|
+
<eref type="inline" bibitemid="ISO713"><locality type="table"><referenceFrom>1</referenceFrom><referenceTo>1</referenceTo></locality></eref>
|
622
|
+
<eref type="inline" bibitemid="ISO713"><locality type="clause"><referenceFrom>1</referenceFrom></locality><locality type="table"><referenceFrom>1</referenceFrom></locality></eref>
|
623
|
+
<eref type="inline" bibitemid="ISO713"><locality type="clause"><referenceFrom>1</referenceFrom></locality></eref>
|
624
|
+
<eref type="inline" bibitemid="ISO713"><locality type="clause"><referenceFrom>1.5</referenceFrom></locality></eref>
|
625
|
+
<eref type="inline" bibitemid="ISO713"><locality type="table"><referenceFrom>1</referenceFrom></locality>A</eref>
|
626
|
+
<eref type="inline" bibitemid="ISO713"><locality type="whole"></locality></eref>
|
627
|
+
<eref type="inline" bibitemid="ISO713"><locality type="locality:prelude"><referenceFrom>7</referenceFrom></locality></eref>
|
628
|
+
<eref type="inline" bibitemid="ISO713" citeas="ISO 713">A</eref>
|
629
|
+
<eref type="inline" bibitemid="ISO713"><locality type="anchor"><referenceFrom>xyz</referenceFrom></locality></eref>
|
630
|
+
<eref type="inline" bibitemid="ISO713"><locality type="anchor"><referenceFrom>xyz</referenceFrom></locality><locality type="clause"><referenceFrom>1</referenceFrom></locality></eref>
|
631
|
+
</p>
|
632
|
+
</foreword></preface>
|
633
|
+
<bibliography><references id="_normative_references" obligation="informative" normative="true"><title>Normative References</title>
|
634
|
+
<bibitem id="ISO712" type="standard">
|
635
|
+
<title format="text/plain">Cereals and cereal products</title>
|
636
|
+
<uri type="citation">http://www.example.com</uri>
|
637
|
+
<docidentifier>ISO 712</docidentifier>
|
638
|
+
<contributor>
|
639
|
+
<role type="publisher"/>
|
640
|
+
<organization>
|
641
|
+
<abbreviation>ISO</abbreviation>
|
642
|
+
</organization>
|
643
|
+
</contributor>
|
644
|
+
</bibitem>
|
645
|
+
<bibitem id="ISO713" type="standard">
|
646
|
+
<title format="text/plain">Cereals and cereal products</title>
|
647
|
+
<uri type="citation">spec/assets/iso713</uri>
|
648
|
+
<docidentifier>ISO 713</docidentifier>
|
649
|
+
<contributor>
|
650
|
+
<role type="publisher"/>
|
651
|
+
<organization>
|
652
|
+
<abbreviation>ISO</abbreviation>
|
653
|
+
</organization>
|
654
|
+
</contributor>
|
655
|
+
</bibitem>
|
656
|
+
</references>
|
657
|
+
</bibliography>
|
658
|
+
</iso-standard>
|
659
|
+
INPUT
|
660
|
+
<html xmlns:epub='http://www.idpf.org/2007/ops' lang='en'>
|
661
|
+
<head>
|
662
|
+
<style>
|
663
|
+
</style>
|
664
|
+
</head>
|
665
|
+
<body lang='EN-US' link='blue' vlink='#954F72'>
|
666
|
+
<div class='WordSection1'>
|
667
|
+
<p> </p>
|
668
|
+
</div>
|
669
|
+
<p>
|
670
|
+
<br clear='all' class='section'/>
|
671
|
+
</p>
|
672
|
+
<div class='WordSection2'>
|
673
|
+
<p>
|
674
|
+
<br clear='all' style='mso-special-character:line-break;page-break-before:always'/>
|
675
|
+
</p>
|
676
|
+
<div>
|
677
|
+
<h1 class='ForewordTitle'>Foreword</h1>
|
678
|
+
<p>
|
679
|
+
<a href='http://www.example.com'>ISO 712</a>
|
680
|
+
<a href='http://www.example.com'>ISO 712</a>
|
681
|
+
<a href='spec/assets/iso713.doc'>ISO 713, Table 1</a>
|
682
|
+
<a href='spec/assets/iso713.doc'>ISO 713, Table 1</a>
|
683
|
+
<a href='spec/assets/iso713.doc'>ISO 713, Table 1; Clause 1</a>
|
684
|
+
<a href='spec/assets/iso713.doc'>ISO 713, Table 1–1</a>
|
685
|
+
<a href='spec/assets/iso713.doc'>ISO 713, Clause 1, Table 1</a>
|
686
|
+
<a href='spec/assets/iso713.doc'>ISO 713, Clause 1</a>
|
687
|
+
<a href='spec/assets/iso713.doc'>ISO 713, Clause 1.5</a>
|
688
|
+
<a href='spec/assets/iso713.doc'>A</a>
|
689
|
+
<a href='spec/assets/iso713.doc'>ISO 713, Whole of text</a>
|
690
|
+
<a href='spec/assets/iso713.doc'>ISO 713, Prelude 7</a>
|
691
|
+
<a href='spec/assets/iso713.doc'>A</a>
|
692
|
+
<a href='spec/assets/iso713.doc#xyz'>ISO 713</a>
|
693
|
+
<a href='spec/assets/iso713.doc#xyz'>ISO 713, Clause 1</a>
|
694
|
+
</p>
|
695
|
+
</div>
|
696
|
+
<p> </p>
|
697
|
+
</div>
|
698
|
+
<p>
|
699
|
+
<br clear='all' class='section'/>
|
700
|
+
</p>
|
701
|
+
<div class='WordSection3'>
|
702
|
+
<p class='zzSTDTitle1'/>
|
703
|
+
<div>
|
704
|
+
<h1>
|
705
|
+
1.
|
706
|
+
<span style='mso-tab-count:1'>  </span>
|
707
|
+
Normative references
|
708
|
+
</h1>
|
709
|
+
<p id='ISO712' class='NormRef'>
|
710
|
+
ISO 712,
|
711
|
+
<i>Cereals and cereal products</i>
|
712
|
+
</p>
|
713
|
+
<p id='ISO713' class='NormRef'>
|
714
|
+
ISO 713,
|
715
|
+
<i>Cereals and cereal products</i>
|
716
|
+
</p>
|
717
|
+
</div>
|
718
|
+
</div>
|
719
|
+
</body>
|
720
|
+
</html>
|
721
|
+
|
722
|
+
OUTPUT
|
723
|
+
end
|
724
|
+
|
725
|
+
it "processes variant" do
|
726
|
+
expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
727
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
728
|
+
<bibdata>
|
729
|
+
<language>en</language>
|
730
|
+
<script>Latn</script>
|
731
|
+
</bibdata>
|
732
|
+
<preface>
|
733
|
+
<clause id="A"><title><variant lang="en" script="Latn">ABC</variant><variant lang="fr" script="Latn">DEF</variant></title></clause>
|
734
|
+
<clause id="B"><title><variant lang="de" script="Latn">GHI</variant><variant lang="es" script="Latn">JKL</variant></title></clause>
|
735
|
+
<clause id="C"><title><variant lang="fr" script="Latn">ABC</variant><variant lang="en" script="Latn">DEF</variant></title></clause>
|
736
|
+
</preface>
|
737
|
+
</iso-standard>
|
738
|
+
INPUT
|
739
|
+
#{HTML_HDR}
|
740
|
+
<br/>
|
741
|
+
<div class='Section3' id='A'>
|
742
|
+
<h1 class='IntroTitle'>ABC</h1>
|
743
|
+
</div>
|
744
|
+
<br/>
|
745
|
+
<div class='Section3' id='B'>
|
746
|
+
<h1 class='IntroTitle'>GHI</h1>
|
747
|
+
</div>
|
748
|
+
<br/>
|
749
|
+
<div class='Section3' id='C'>
|
750
|
+
<h1 class='IntroTitle'>DEF</h1>
|
751
|
+
</div>
|
752
|
+
<p class='zzSTDTitle1'/>
|
753
|
+
</div>
|
754
|
+
</body>
|
755
|
+
</html>
|
756
|
+
OUTPUT
|
757
|
+
end
|
758
|
+
|
759
|
+
it "cases xrefs" do
|
760
|
+
expect(xmlpp(IsoDoc::HtmlConvert.new({i18nyaml: "spec/assets/i18n.yaml"}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
761
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
762
|
+
<sections>
|
763
|
+
<clause id="A">
|
764
|
+
<table id="B">
|
765
|
+
</table>
|
766
|
+
</clause>
|
767
|
+
<clause id="C">
|
768
|
+
<p>This is <xref target="A"/> and <xref target="B"/>.
|
769
|
+
This is <xref target="A" case="capital"/> and <xref target="B" case="lowercase"/>.
|
770
|
+
<xref target="A"/> is clause <em>initial.</em><br/>
|
771
|
+
<xref target="A"/> is too. </p>
|
772
|
+
<p><xref target="A"/> is also.</p>
|
773
|
+
</clause>
|
774
|
+
</sections>
|
775
|
+
</iso-standard>
|
776
|
+
INPUT
|
777
|
+
#{HTML_HDR}
|
778
|
+
<p class='zzSTDTitle1'/>
|
779
|
+
<div id='A'>
|
780
|
+
<h1>1.  </h1>
|
781
|
+
<p class='TableTitle' style='text-align:center;'>Tabelo 1</p>
|
782
|
+
<table id='B' class='MsoISOTable' style='border-width:1px;border-spacing:0;'/>
|
783
|
+
</div>
|
784
|
+
<div id='C'>
|
785
|
+
<h1>2.  </h1>
|
786
|
+
<p>
|
787
|
+
This is
|
788
|
+
<a href='#A'>klaŭzo 1</a>
|
789
|
+
and
|
790
|
+
<a href='#B'>Tabelo 1</a>
|
791
|
+
. This is
|
792
|
+
<a href='#A'>Klaŭzo 1</a>
|
793
|
+
and
|
794
|
+
<a href='#B'>tabelo 1</a>
|
795
|
+
.
|
796
|
+
<a href='#A'>Klaŭzo 1</a>
|
797
|
+
is clause
|
798
|
+
<i>initial.</i>
|
799
|
+
<br/>
|
800
|
+
<a href='#A'>Klaŭzo 1</a>
|
801
|
+
is too.
|
802
|
+
</p>
|
803
|
+
<p>
|
804
|
+
<a href='#A'>Klaŭzo 1</a>
|
805
|
+
is also.
|
806
|
+
</p>
|
807
|
+
</div>
|
808
|
+
</div>
|
809
|
+
</body>
|
810
|
+
</html>
|
811
|
+
OUTPUT
|
812
|
+
end
|
518
813
|
|
519
814
|
end
|
data/spec/isodoc/lists_spec.rb
CHANGED
@@ -5,7 +5,7 @@ RSpec.describe IsoDoc do
|
|
5
5
|
expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
6
6
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
7
7
|
<preface><foreword>
|
8
|
-
<ul id="_61961034-0fb1-436b-b281-828857a59ddb">
|
8
|
+
<ul id="_61961034-0fb1-436b-b281-828857a59ddb" keep-with-next="true" keep-lines-together="true">
|
9
9
|
<li>
|
10
10
|
<p id="_cb370dd3-8463-4ec7-aa1a-96f644e2e9a2">updated normative references;</p>
|
11
11
|
</li>
|
@@ -20,7 +20,7 @@ RSpec.describe IsoDoc do
|
|
20
20
|
<br/>
|
21
21
|
<div>
|
22
22
|
<h1 class="ForewordTitle">Foreword</h1>
|
23
|
-
<ul id="_61961034-0fb1-436b-b281-828857a59ddb">
|
23
|
+
<ul id="_61961034-0fb1-436b-b281-828857a59ddb" style="page-break-after: avoid;page-break-inside: avoid;">
|
24
24
|
<li>
|
25
25
|
<p id="_cb370dd3-8463-4ec7-aa1a-96f644e2e9a2">updated normative references;</p>
|
26
26
|
</li>
|
@@ -136,7 +136,7 @@ RSpec.describe IsoDoc do
|
|
136
136
|
expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
137
137
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
138
138
|
<preface><foreword>
|
139
|
-
<ol id="_ae34a226-aab4-496d-987b-1aa7b6314026" type="alphabet">
|
139
|
+
<ol id="_ae34a226-aab4-496d-987b-1aa7b6314026" type="alphabet" keep-with-next="true" keep-lines-together="true">
|
140
140
|
<li>
|
141
141
|
<p id="_0091a277-fb0e-424a-aea8-f0001303fe78">all information necessary for the complete identification of the sample;</p>
|
142
142
|
</li>
|
@@ -158,7 +158,7 @@ RSpec.describe IsoDoc do
|
|
158
158
|
<br/>
|
159
159
|
<div>
|
160
160
|
<h1 class="ForewordTitle">Foreword</h1>
|
161
|
-
<ol type="a" id="_ae34a226-aab4-496d-987b-1aa7b6314026">
|
161
|
+
<ol type="a" id="_ae34a226-aab4-496d-987b-1aa7b6314026" style="page-break-after: avoid;page-break-inside: avoid;">
|
162
162
|
<li>
|
163
163
|
<p id="_0091a277-fb0e-424a-aea8-f0001303fe78">all information necessary for the complete identification of the sample;</p>
|
164
164
|
</li>
|
@@ -226,7 +226,7 @@ RSpec.describe IsoDoc do
|
|
226
226
|
expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
227
227
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
228
228
|
<preface><foreword>
|
229
|
-
<dl id="_732d3f57-4f88-40bf-9ae9-633891edc395">
|
229
|
+
<dl id="_732d3f57-4f88-40bf-9ae9-633891edc395" keep-with-next="true" keep-lines-together="true">
|
230
230
|
<dt>
|
231
231
|
W
|
232
232
|
</dt>
|
@@ -244,7 +244,7 @@ RSpec.describe IsoDoc do
|
|
244
244
|
<br/>
|
245
245
|
<div>
|
246
246
|
<h1 class="ForewordTitle">Foreword</h1>
|
247
|
-
<dl id="_732d3f57-4f88-40bf-9ae9-633891edc395">
|
247
|
+
<dl id="_732d3f57-4f88-40bf-9ae9-633891edc395" style="page-break-after: avoid;page-break-inside: avoid;">
|
248
248
|
<dt>
|
249
249
|
<p>
|
250
250
|
W
|
@@ -260,7 +260,7 @@ RSpec.describe IsoDoc do
|
|
260
260
|
<p>??</p>
|
261
261
|
</dd>
|
262
262
|
</dl>
|
263
|
-
<div
|
263
|
+
<div class="Note">
|
264
264
|
<p><span class="note_label">NOTE</span>  This is a note</p>
|
265
265
|
</div>
|
266
266
|
</div>
|
@@ -323,7 +323,7 @@ RSpec.describe IsoDoc do
|
|
323
323
|
</tr>
|
324
324
|
<tr>
|
325
325
|
<td colspan="2">
|
326
|
-
<div
|
326
|
+
<div class="Note">
|
327
327
|
<p class="Note"><span class="note_label">NOTE</span><span style="mso-tab-count:1">  </span>This is a note</p>
|
328
328
|
</div>
|
329
329
|
</td>
|