isodoc 1.7.6.1 → 1.8.2
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/isodoc.gemspec +2 -2
- data/lib/isodoc/class_utils.rb +24 -1
- data/lib/isodoc/convert.rb +9 -0
- data/lib/isodoc/function/cleanup.rb +4 -0
- data/lib/isodoc/function/inline.rb +3 -5
- data/lib/isodoc/html_function/html.rb +1 -0
- data/lib/isodoc/html_function/postprocess.rb +4 -6
- data/lib/isodoc/metadata_date.rb +13 -11
- data/lib/isodoc/presentation_function/bibdata.rb +2 -2
- data/lib/isodoc/presentation_function/block.rb +0 -36
- data/lib/isodoc/presentation_function/inline.rb +14 -11
- data/lib/isodoc/presentation_function/terms.rb +223 -0
- data/lib/isodoc/presentation_xml_convert.rb +11 -4
- data/lib/isodoc/version.rb +1 -1
- data/lib/isodoc/word_function/body.rb +24 -14
- data/lib/isodoc/word_function/comments.rb +0 -4
- data/lib/isodoc/word_function/postprocess.rb +184 -176
- data/lib/isodoc/xref/xref_gen.rb +18 -22
- data/lib/isodoc/xref/xref_gen_seq.rb +10 -16
- data/lib/isodoc/xref/xref_sect_gen.rb +134 -129
- data/lib/isodoc/xslfo_convert.rb +11 -7
- data/lib/isodoc-yaml/i18n-ar.yaml +25 -0
- data/lib/isodoc-yaml/i18n-de.yaml +23 -0
- data/lib/isodoc-yaml/i18n-en.yaml +23 -0
- data/lib/isodoc-yaml/i18n-es.yaml +23 -0
- data/lib/isodoc-yaml/i18n-fr.yaml +23 -0
- data/lib/isodoc-yaml/i18n-ru.yaml +24 -1
- data/lib/isodoc-yaml/i18n-zh-Hans.yaml +24 -0
- data/lib/metanorma/output/xslfo.rb +4 -11
- data/spec/assets/i18n.yaml +3 -1
- data/spec/isodoc/blocks_spec.rb +14 -8
- data/spec/isodoc/i18n_spec.rb +23 -18
- data/spec/isodoc/inline_spec.rb +193 -9
- data/spec/isodoc/lists_spec.rb +344 -222
- data/spec/isodoc/section_spec.rb +23 -22
- data/spec/isodoc/table_spec.rb +71 -73
- data/spec/isodoc/terms_spec.rb +498 -124
- data/spec/isodoc/xref_numbering_spec.rb +347 -0
- data/spec/isodoc/xref_spec.rb +274 -353
- data/spec/isodoc/xslfo_convert_spec.rb +34 -9
- metadata +12 -11
- data/lib/isodoc/presentation_function/concept.rb +0 -68
data/spec/isodoc/i18n_spec.rb
CHANGED
@@ -24,7 +24,7 @@ RSpec.describe IsoDoc do
|
|
24
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
|
-
<preferred>Term2</preferred>
|
27
|
+
<preferred><expression><name>Term2</name></expression></preferred>
|
28
28
|
</term>
|
29
29
|
</terms>
|
30
30
|
<definitions id="K">
|
@@ -88,7 +88,7 @@ RSpec.describe IsoDoc do
|
|
88
88
|
<clause id="H" obligation="normative" displayorder="5"><title depth="1">3.<tab/>Terms, definitions, symbols and abbreviated terms</title><terms id="I" obligation="normative">
|
89
89
|
<title depth="2">3.1.<tab/>Normal Terms</title>
|
90
90
|
<term id="J"><name>3.1.1.</name>
|
91
|
-
<preferred>Term2</preferred>
|
91
|
+
<preferred><strong>Term2</strong></preferred>
|
92
92
|
</term>
|
93
93
|
</terms>
|
94
94
|
<definitions id="K"><title>3.2.</title>
|
@@ -159,7 +159,7 @@ RSpec.describe IsoDoc do
|
|
159
159
|
<div id="I">
|
160
160
|
<h2>3.1.  Normal Terms</h2>
|
161
161
|
<p class="TermNum" id="J">3.1.1.</p>
|
162
|
-
<p class="Terms" style="text-align:left;">Term2</p>
|
162
|
+
<p class="Terms" style="text-align:left;"><b>Term2</b></p>
|
163
163
|
</div><div id="K"><h2>3.2.</h2>
|
164
164
|
<dl><dt><p>Symbol</p></dt><dd>Definition</dd></dl>
|
165
165
|
</div></div>
|
@@ -211,7 +211,7 @@ RSpec.describe IsoDoc do
|
|
211
211
|
end
|
212
212
|
|
213
213
|
it "defaults to English" do
|
214
|
-
|
214
|
+
input = <<~INPUT
|
215
215
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
216
216
|
<bibdata>
|
217
217
|
<language>tlh</language>
|
@@ -233,7 +233,7 @@ RSpec.describe IsoDoc do
|
|
233
233
|
<clause id="H" obligation="normative"><title>Terms, definitions, symbols and abbreviated terms</title><terms id="I" obligation="normative">
|
234
234
|
<title>Normal Terms</title>
|
235
235
|
<term id="J">
|
236
|
-
<preferred>Term2</preferred>
|
236
|
+
<preferred><expression><name>Term2</name></expression></preferred>
|
237
237
|
</term>
|
238
238
|
</terms>
|
239
239
|
<definitions id="K">
|
@@ -275,6 +275,7 @@ RSpec.describe IsoDoc do
|
|
275
275
|
</bibliography>
|
276
276
|
</iso-standard>
|
277
277
|
INPUT
|
278
|
+
output = <<~OUTPUT
|
278
279
|
<iso-standard xmlns="http://riboseinc.com/isoxml" type="presentation">
|
279
280
|
<bibdata>
|
280
281
|
<language current="true">tlh</language>
|
@@ -295,7 +296,7 @@ RSpec.describe IsoDoc do
|
|
295
296
|
<clause id="H" obligation="normative" displayorder="5"><title depth="1">3.<tab/>Terms, definitions, symbols and abbreviated terms</title><terms id="I" obligation="normative">
|
296
297
|
<title depth="2">3.1.<tab/>Normal Terms</title>
|
297
298
|
<term id="J"><name>3.1.1.</name>
|
298
|
-
<preferred>Term2</preferred>
|
299
|
+
<preferred><strong>Term2</strong></preferred>
|
299
300
|
</term>
|
300
301
|
</terms>
|
301
302
|
<definitions id="K"><title>3.2.</title>
|
@@ -336,6 +337,10 @@ RSpec.describe IsoDoc do
|
|
336
337
|
</bibliography>
|
337
338
|
</iso-standard>
|
338
339
|
OUTPUT
|
340
|
+
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
|
341
|
+
.convert("test", input, true)
|
342
|
+
.sub(%r{<localized-strings>.*</localized-strings>}m, "")))
|
343
|
+
.to be_equivalent_to xmlpp(output)
|
339
344
|
end
|
340
345
|
|
341
346
|
it "processes French" do
|
@@ -361,7 +366,7 @@ RSpec.describe IsoDoc do
|
|
361
366
|
<clause id="H" obligation="normative"><title>Terms, definitions, symbols and abbreviated terms</title><terms id="I" obligation="normative">
|
362
367
|
<title>Normal Terms</title>
|
363
368
|
<term id="J">
|
364
|
-
<preferred>Term2</preferred>
|
369
|
+
<preferred><expression><name>Term2</name></expression></preferred>
|
365
370
|
</term>
|
366
371
|
</terms>
|
367
372
|
<definitions id="K">
|
@@ -425,7 +430,7 @@ RSpec.describe IsoDoc do
|
|
425
430
|
<clause id="H" obligation="normative" displayorder="5"><title depth="1">3.<tab/>Terms, definitions, symbols and abbreviated terms</title><terms id="I" obligation="normative">
|
426
431
|
<title depth="2">3.1.<tab/>Normal Terms</title>
|
427
432
|
<term id="J"><name>3.1.1.</name>
|
428
|
-
<preferred>Term2</preferred>
|
433
|
+
<preferred><strong>Term2</strong></preferred>
|
429
434
|
</term>
|
430
435
|
</terms>
|
431
436
|
<definitions id="K"><title>3.2.</title>
|
@@ -496,7 +501,7 @@ RSpec.describe IsoDoc do
|
|
496
501
|
<div id="I">
|
497
502
|
<h2>3.1.  Normal Terms</h2>
|
498
503
|
<p class="TermNum" id="J">3.1.1.</p>
|
499
|
-
<p class="Terms" style="text-align:left;">Term2</p>
|
504
|
+
<p class="Terms" style="text-align:left;"><b>Term2</b></p>
|
500
505
|
</div><div id="K"><h2>3.2.</h2>
|
501
506
|
<dl><dt><p>Symbol</p></dt><dd>Definition</dd></dl>
|
502
507
|
</div></div>
|
@@ -570,7 +575,7 @@ RSpec.describe IsoDoc do
|
|
570
575
|
<clause id="H" obligation="normative"><title>Terms, definitions, symbols and abbreviated terms</title><terms id="I" obligation="normative">
|
571
576
|
<title>Normal Terms</title>
|
572
577
|
<term id="J">
|
573
|
-
<preferred>Term2</preferred>
|
578
|
+
<preferred><expression><name>Term2</name></expression></preferred>
|
574
579
|
</term>
|
575
580
|
</terms>
|
576
581
|
<definitions id="K">
|
@@ -644,7 +649,7 @@ RSpec.describe IsoDoc do
|
|
644
649
|
<clause id="H" obligation="normative" displayorder="5"><title depth="1">3.<tab/>Terms, definitions, symbols and abbreviated terms</title><terms id="I" obligation="normative">
|
645
650
|
<title depth="2">3.1.<tab/>Normal Terms</title>
|
646
651
|
<term id="J"><name>3.1.1.</name>
|
647
|
-
<preferred>Term2</preferred>
|
652
|
+
<preferred><strong>Term2</strong></preferred>
|
648
653
|
</term>
|
649
654
|
</terms>
|
650
655
|
<definitions id="K"><title>3.2.</title>
|
@@ -728,7 +733,7 @@ RSpec.describe IsoDoc do
|
|
728
733
|
<div id="I">
|
729
734
|
<h2>3.1. Normal Terms</h2>
|
730
735
|
<p class="TermNum" id="J">3.1.1.</p>
|
731
|
-
<p class="Terms" style="text-align:left;">Term2</p>
|
736
|
+
<p class="Terms" style="text-align:left;"><b>Term2</b></p>
|
732
737
|
</div><div id="K"><h2>3.2.</h2>
|
733
738
|
<dl><dt><p>Symbol</p></dt><dd>Definition</dd></dl>
|
734
739
|
</div></div>
|
@@ -812,7 +817,7 @@ RSpec.describe IsoDoc do
|
|
812
817
|
<clause id="H" obligation="normative"><title>Terms, definitions, symbols and abbreviated terms</title><terms id="I" obligation="normative">
|
813
818
|
<title>Normal Terms</title>
|
814
819
|
<term id="J">
|
815
|
-
<preferred>Term2</preferred>
|
820
|
+
<preferred><expression><name>Term2</name></expression></preferred>
|
816
821
|
</term>
|
817
822
|
</terms>
|
818
823
|
<definitions id="K">
|
@@ -877,7 +882,7 @@ RSpec.describe IsoDoc do
|
|
877
882
|
<ext>
|
878
883
|
<doctype language="">brochure</doctype><doctype language="eo">broŝuro</doctype>
|
879
884
|
</ext>
|
880
|
-
</bibdata><localized-strings><localized-string key="foreword" language="eo">Antaŭparolo</localized-string><localized-string key="introduction" language="eo">Enkonduko</localized-string><localized-string key="clause" language="eo">klaŭzo</localized-string><localized-string key="table" language="eo">tabelo</localized-string><localized-string key="source" language="eo">SOURCE</localized-string><localized-string key="modified" language="eo">modified</localized-string><localized-string key="scope" language="eo">Amplekso</localized-string><localized-string key="symbols" language="eo">Simboloj kai mallongigitaj terminoj</localized-string><localized-string key="annex" language="eo">
|
885
|
+
</bibdata><localized-strings><localized-string key="foreword" language="eo">Antaŭparolo</localized-string><localized-string key="introduction" language="eo">Enkonduko</localized-string><localized-string key="clause" language="eo">klaŭzo</localized-string><localized-string key="table" language="eo">tabelo</localized-string><localized-string key="source" language="eo">SOURCE</localized-string><localized-string key="modified" language="eo">modified</localized-string><localized-string key="scope" language="eo">Amplekso</localized-string><localized-string key="symbols" language="eo">Simboloj kai mallongigitaj terminoj</localized-string><localized-string key="annex" language="eo"><strong>aldono</strong></localized-string><localized-string key="normref" language="eo">Normaj citaĵoj</localized-string><localized-string key="bibliography" language="eo">Bibliografio</localized-string><localized-string key="inform_annex" language="eo">informa</localized-string><localized-string key="all_parts" language="eo">ĉiuj partoj</localized-string><localized-string key="norm_annex" language="eo">normative</localized-string><localized-string key='figure' language='eo'>figur-etikedo duvorta</localized-string><localized-string key='example' language='eo'>Ekzempl-etikedo Duvorta</localized-string><localized-string key="note" language="eo">NOTO</localized-string><localized-string key="locality.table" language="eo">Tabelo</localized-string><localized-string key="doctype_dict.brochure" language="eo">broŝuro</localized-string><localized-string key="doctype_dict.conference_proceedings" language="eo">konferencaktoj</localized-string><localized-string key="stage_dict.published" language="eo">publikigita</localized-string><localized-string key="substage_dict.withdrawn" language="eo">fortirita</localized-string><localized-string key="array.0" language="eo">elem1</localized-string><localized-string key="array.1" language="eo">elem2</localized-string><localized-string key="array.2.elem3" language="eo">elem4</localized-string><localized-string key="array.2.elem5" language="eo">elem6</localized-string><localized-string key="language" language="eo">eo</localized-string><localized-string key="script" language="eo">Latn</localized-string></localized-strings>
|
881
886
|
<preface>
|
882
887
|
<foreword obligation="informative" displayorder="1">
|
883
888
|
<title>Foreword</title>
|
@@ -896,7 +901,7 @@ RSpec.describe IsoDoc do
|
|
896
901
|
<clause id="H" obligation="normative" displayorder="5"><title depth="1">3.<tab/>Terms, definitions, symbols and abbreviated terms</title><terms id="I" obligation="normative">
|
897
902
|
<title depth="2">3.1.<tab/>Normal Terms</title>
|
898
903
|
<term id="J"><name>3.1.1.</name>
|
899
|
-
<preferred>Term2</preferred>
|
904
|
+
<preferred><strong>Term2</strong></preferred>
|
900
905
|
</term>
|
901
906
|
</terms>
|
902
907
|
<definitions id="K"><title>3.2.</title>
|
@@ -920,7 +925,7 @@ RSpec.describe IsoDoc do
|
|
920
925
|
<title depth="2">5.2.<tab/>Clause 4.2</title>
|
921
926
|
</clause></clause>
|
922
927
|
</sections><annex id="P" inline-header="false" obligation="normative" displayorder="8">
|
923
|
-
<title><strong>Aldono A</strong><br/>(normative)<br/><br/><strong>Annex</strong></title>
|
928
|
+
<title><strong><strong>Aldono</strong> A</strong><br/>(normative)<br/><br/><strong>Annex</strong></title>
|
924
929
|
<clause id="Q" inline-header="false" obligation="normative">
|
925
930
|
<title depth="2">A.1.<tab/>Annex A.1</title>
|
926
931
|
<clause id="Q1" inline-header="false" obligation="normative">
|
@@ -1002,7 +1007,7 @@ RSpec.describe IsoDoc do
|
|
1002
1007
|
<div id='I'>
|
1003
1008
|
<h2>3.1.  Normal Terms</h2>
|
1004
1009
|
<p class='TermNum' id='J'>3.1.1.</p>
|
1005
|
-
<p class='Terms' style='text-align:left;'>Term2</p>
|
1010
|
+
<p class='Terms' style='text-align:left;'><b>Term2</b></p>
|
1006
1011
|
</div>
|
1007
1012
|
<div id='K'>
|
1008
1013
|
<h2>3.2.</h2>
|
@@ -1041,7 +1046,7 @@ RSpec.describe IsoDoc do
|
|
1041
1046
|
<br/>
|
1042
1047
|
<div id='P' class='Section3'>
|
1043
1048
|
<h1 class='Annex'>
|
1044
|
-
<b>Aldono A</b>
|
1049
|
+
<b><b>Aldono</b> A</b>
|
1045
1050
|
<br/>
|
1046
1051
|
(normative)
|
1047
1052
|
<br/>
|
data/spec/isodoc/inline_spec.rb
CHANGED
@@ -625,6 +625,74 @@ RSpec.describe IsoDoc do
|
|
625
625
|
.convert("test", presxml, true))).to be_equivalent_to xmlpp(output)
|
626
626
|
end
|
627
627
|
|
628
|
+
it "processes related terms" do
|
629
|
+
input = <<~INPUT
|
630
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
631
|
+
<sections>
|
632
|
+
<terms id='A' obligation='normative'>
|
633
|
+
<title>Terms and definitions</title>
|
634
|
+
<term id='second'>
|
635
|
+
<preferred>
|
636
|
+
<expression>
|
637
|
+
<name>Second Term</name>
|
638
|
+
</expression>
|
639
|
+
<field-of-application>Field</field-of-application>
|
640
|
+
<usage-info>Usage Info 1</usage-info>
|
641
|
+
</preferred>
|
642
|
+
<definition><verbal-definition>Definition 1</verbal-definition></definition>
|
643
|
+
</term>
|
644
|
+
<term id="C">
|
645
|
+
<preferred language='fr' script='Latn' type='prefix'>
|
646
|
+
<expression>
|
647
|
+
<name>First Designation</name>
|
648
|
+
</expression></preferred>
|
649
|
+
<related type='contrast'>
|
650
|
+
<preferred>
|
651
|
+
<expression>
|
652
|
+
<name>Fifth Designation</name>
|
653
|
+
<grammar>
|
654
|
+
<gender>neuter</gender>
|
655
|
+
</grammar>
|
656
|
+
</expression>
|
657
|
+
</preferred>
|
658
|
+
<xref target='second'/>
|
659
|
+
</related>
|
660
|
+
<definition><verbal-definition>Definition 2</verbal-definition></definition>
|
661
|
+
</term>
|
662
|
+
</terms>
|
663
|
+
</sections>
|
664
|
+
</iso-standard>
|
665
|
+
INPUT
|
666
|
+
output = <<~OUTPUT
|
667
|
+
<?xml version='1.0'?>
|
668
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type='presentation'>
|
669
|
+
<sections>
|
670
|
+
<terms id='A' obligation='normative' displayorder='1'>
|
671
|
+
<title depth='1'>1.<tab/>Terms and definitions</title>
|
672
|
+
<term id='second'>
|
673
|
+
<name>1.1.</name>
|
674
|
+
<preferred><strong>Second Term</strong>, <Field, Usage Info 1></preferred>
|
675
|
+
<definition>Definition 1</definition>
|
676
|
+
</term>
|
677
|
+
<term id='C'>
|
678
|
+
<name>1.2.</name>
|
679
|
+
<preferred language='fr' script='Latn' type='prefix'><strong>First Designation</strong></preferred>
|
680
|
+
<p>
|
681
|
+
<strong>CONTRAST:</strong>
|
682
|
+
<em>
|
683
|
+
<preferred><strong>Fifth Designation</strong>, n</preferred>
|
684
|
+
</em> (<xref target='second'>Clause 1.1</xref>)
|
685
|
+
</p>
|
686
|
+
<definition>Definition 2</definition>
|
687
|
+
</term>
|
688
|
+
</terms>
|
689
|
+
</sections>
|
690
|
+
</iso-standard>
|
691
|
+
OUTPUT
|
692
|
+
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
|
693
|
+
.convert("test", input, true))).to be_equivalent_to xmlpp(output)
|
694
|
+
end
|
695
|
+
|
628
696
|
it "processes embedded inline formatting" do
|
629
697
|
input = <<~INPUT
|
630
698
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
@@ -724,9 +792,9 @@ RSpec.describe IsoDoc do
|
|
724
792
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
725
793
|
<preface><foreword>
|
726
794
|
<p>
|
727
|
-
<link
|
728
|
-
<link
|
729
|
-
<link
|
795
|
+
<link update-type="true" target="http://example.com"/>
|
796
|
+
<link update-type="true" target="list.adoc">example</link>
|
797
|
+
<link update-type="true" target="list" alt="tip">example</link>
|
730
798
|
</p>
|
731
799
|
</foreword></preface>
|
732
800
|
<sections>
|
@@ -1505,6 +1573,122 @@ RSpec.describe IsoDoc do
|
|
1505
1573
|
end
|
1506
1574
|
|
1507
1575
|
it "cases xrefs" do
|
1576
|
+
input = <<~INPUT
|
1577
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
1578
|
+
<preface>
|
1579
|
+
<clause id="CC"><title>Introduction</title></clause>
|
1580
|
+
<sections>
|
1581
|
+
<clause id="A">
|
1582
|
+
<table id="B">
|
1583
|
+
</table>
|
1584
|
+
<figure id="B1"/>
|
1585
|
+
<example id="B2"/>
|
1586
|
+
</clause>
|
1587
|
+
<clause id="C">
|
1588
|
+
<p>This is <xref target="A"/> and <xref target="B"/>.
|
1589
|
+
This is <xref target="A" case="capital"/> and <xref target="B" case="lowercase"/>.
|
1590
|
+
This is <xref target="A" case="lowercase"/> and <xref target="B" case="capital"/>.
|
1591
|
+
Downcasing an xref affects only the first letter: <xref target="B2" case="lowercase"/>.
|
1592
|
+
Capitalising an xref affects only the first letter: <xref target="B1" case="capital"/>.
|
1593
|
+
<xref target="A"/> is clause <em>initial.</em><br/>
|
1594
|
+
<xref target="A"/> is too. </p>
|
1595
|
+
<p><xref target="A"/> is also.</p>
|
1596
|
+
<p>Annex has formatting, and crossreferences ignore it when determining casing. <xref target="AA"/>.</p>
|
1597
|
+
<p>Labels are not subject to casing: <xref target="CC" case="lowercase"/>
|
1598
|
+
</clause>
|
1599
|
+
<annex id="AA">
|
1600
|
+
<clause id="AA1"/>
|
1601
|
+
</annex>
|
1602
|
+
</sections>
|
1603
|
+
</iso-standard>
|
1604
|
+
INPUT
|
1605
|
+
output = <<~OUTPUT
|
1606
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type='presentation'>
|
1607
|
+
<preface>
|
1608
|
+
<clause id='CC' displayorder='1'>
|
1609
|
+
<title depth='1'>Introduction</title>
|
1610
|
+
</clause>
|
1611
|
+
<sections displayorder='2'>
|
1612
|
+
<clause id='A' displayorder='3'>
|
1613
|
+
<title>1.</title>
|
1614
|
+
<table id='B'>
|
1615
|
+
<name>Tabelo 1</name>
|
1616
|
+
</table>
|
1617
|
+
<figure id='B1'>
|
1618
|
+
<name>Figur-etikedo duvorta 1</name>
|
1619
|
+
</figure>
|
1620
|
+
<example id='B2'>
|
1621
|
+
<name>Ekzempl-etikedo Duvorta</name>
|
1622
|
+
</example>
|
1623
|
+
</clause>
|
1624
|
+
<clause id='C' displayorder='4'>
|
1625
|
+
<title>2.</title>
|
1626
|
+
<p>
|
1627
|
+
This is
|
1628
|
+
<xref target='A'>klaŭzo 1</xref>
|
1629
|
+
and
|
1630
|
+
<xref target='B'>tabelo 1</xref>
|
1631
|
+
. This is
|
1632
|
+
<xref target='A' case='capital'>Klaŭzo 1</xref>
|
1633
|
+
and
|
1634
|
+
<xref target='B' case='lowercase'>tabelo 1</xref>
|
1635
|
+
. This is
|
1636
|
+
<xref target='A' case='lowercase'>klaŭzo 1</xref>
|
1637
|
+
and
|
1638
|
+
<xref target='B' case='capital'>Tabelo 1</xref>
|
1639
|
+
. Downcasing an xref affects only the first letter:
|
1640
|
+
<xref target='B2' case='lowercase'>klaŭzo 1, Example</xref>
|
1641
|
+
. Capitalising an xref affects only the first letter:
|
1642
|
+
<xref target='B1' case='capital'>Figur-etikedo duvorta 1</xref>
|
1643
|
+
.
|
1644
|
+
<xref target='A'>Klaŭzo 1</xref>
|
1645
|
+
is clause
|
1646
|
+
<em>initial.</em>
|
1647
|
+
<br/>
|
1648
|
+
<xref target='A'>Klaŭzo 1</xref>
|
1649
|
+
is too.
|
1650
|
+
</p>
|
1651
|
+
<p>
|
1652
|
+
<xref target='A'>Klaŭzo 1</xref>
|
1653
|
+
is also.
|
1654
|
+
</p>
|
1655
|
+
<p>
|
1656
|
+
Annex has formatting, and crossreferences ignore it when determining
|
1657
|
+
casing.
|
1658
|
+
<xref target='AA'>
|
1659
|
+
<strong>Aldono</strong>
|
1660
|
+
A
|
1661
|
+
</xref>
|
1662
|
+
.
|
1663
|
+
</p>
|
1664
|
+
<p>
|
1665
|
+
Labels are not subject to casing:
|
1666
|
+
<xref target='CC' case='lowercase'>Introduction</xref>
|
1667
|
+
</p>
|
1668
|
+
<annex id='AA' displayorder='5'>
|
1669
|
+
<title>
|
1670
|
+
<strong>
|
1671
|
+
<strong>Aldono</strong>
|
1672
|
+
A
|
1673
|
+
</strong>
|
1674
|
+
<br/>
|
1675
|
+
(informa)
|
1676
|
+
</title>
|
1677
|
+
<clause id='AA1'>
|
1678
|
+
<title>A.1.</title>
|
1679
|
+
</clause>
|
1680
|
+
</annex>
|
1681
|
+
</clause>
|
1682
|
+
</sections>
|
1683
|
+
</preface>
|
1684
|
+
</iso-standard>
|
1685
|
+
OUTPUT
|
1686
|
+
expect(xmlpp(IsoDoc::PresentationXMLConvert
|
1687
|
+
.new({ i18nyaml: "spec/assets/i18n.yaml" })
|
1688
|
+
.convert("test", input, true))).to be_equivalent_to xmlpp(output)
|
1689
|
+
end
|
1690
|
+
|
1691
|
+
it "ignores casing of xrefs in unicameral scripts" do
|
1508
1692
|
input = <<~INPUT
|
1509
1693
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
1510
1694
|
<sections>
|
@@ -1541,23 +1725,23 @@ RSpec.describe IsoDoc do
|
|
1541
1725
|
and
|
1542
1726
|
<xref target='B'>tabelo 1</xref>
|
1543
1727
|
. This is
|
1544
|
-
<xref target='A' case='capital'>
|
1728
|
+
<xref target='A' case='capital'>klaŭzo 1</xref>
|
1545
1729
|
and
|
1546
1730
|
<xref target='B' case='lowercase'>tabelo 1</xref>
|
1547
1731
|
. This is
|
1548
1732
|
<xref target='A' case='lowercase'>klaŭzo 1</xref>
|
1549
1733
|
and
|
1550
|
-
<xref target='B' case='capital'>
|
1734
|
+
<xref target='B' case='capital'>tabelo 1</xref>
|
1551
1735
|
.
|
1552
|
-
<xref target='A'>
|
1736
|
+
<xref target='A'>klaŭzo 1</xref>
|
1553
1737
|
is clause
|
1554
1738
|
<em>initial.</em>
|
1555
1739
|
<br/>
|
1556
|
-
<xref target='A'>
|
1740
|
+
<xref target='A'>klaŭzo 1</xref>
|
1557
1741
|
is too.
|
1558
1742
|
</p>
|
1559
1743
|
<p>
|
1560
|
-
<xref target='A'>
|
1744
|
+
<xref target='A'>klaŭzo 1</xref>
|
1561
1745
|
is also.
|
1562
1746
|
</p>
|
1563
1747
|
</clause>
|
@@ -1565,7 +1749,7 @@ RSpec.describe IsoDoc do
|
|
1565
1749
|
</iso-standard>
|
1566
1750
|
OUTPUT
|
1567
1751
|
expect(xmlpp(IsoDoc::PresentationXMLConvert
|
1568
|
-
.new({ i18nyaml: "spec/assets/i18n.yaml" })
|
1752
|
+
.new({ i18nyaml: "spec/assets/i18n.yaml", script: "Hans" })
|
1569
1753
|
.convert("test", input, true))).to be_equivalent_to xmlpp(output)
|
1570
1754
|
end
|
1571
1755
|
|