metanorma-iso 1.3.18 → 1.3.19
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/asciidoctor/iso/converter.rb +0 -1
- data/lib/isodoc/iso/base_convert.rb +4 -0
- data/lib/isodoc/iso/html/style-human.scss +3 -3
- data/lib/isodoc/iso/html/style-iso.scss +99 -3
- data/lib/isodoc/iso/html_convert.rb +4 -0
- data/lib/isodoc/iso/word_convert.rb +4 -0
- data/lib/metanorma/iso/version.rb +1 -1
- data/spec/asciidoctor-iso/base_spec.rb +4 -4
- data/spec/asciidoctor-iso/blocks_spec.rb +1 -1
- data/spec/asciidoctor-iso/cleanup_spec.rb +19 -19
- data/spec/asciidoctor-iso/section_spec.rb +3 -3
- data/spec/asciidoctor-iso/table_spec.rb +14 -14
- data/spec/isodoc/iso_spec.rb +5 -5
- data/spec/isodoc/postproc_spec.rb +130 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7cb914a2716a7b69da948ab0c1429449e23856ae88264944ed6cc5404d3ee0f3
|
4
|
+
data.tar.gz: 88847296644b6ba8112cf60624eef6ee13086002f6d0874484d3b4d19eb9912b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6223e510985b9bcedc831981437cce49d8e260573d10b9e841a08d37d4dd9c3363211e648a2c9e63e7377b26ef929e7fb0a43a40e424b7f56cd3047b5b92d715
|
7
|
+
data.tar.gz: 365452eb2e3cc2fc558bb800aad37abcdcb85e38f6ef5af7fd34457651174bba7789797974755b9b6298e711ff73ca301ddc7ee158c7c3cbf2f30dfbbe6a0e95
|
@@ -621,12 +621,12 @@ margin-left: 2em;
|
|
621
621
|
3.6 Source Code + figures
|
622
622
|
*/
|
623
623
|
|
624
|
-
|
624
|
+
pre {
|
625
625
|
font-family: $monospacefont;
|
626
626
|
font-variant-ligatures: none;
|
627
627
|
}
|
628
628
|
|
629
|
-
.figure,
|
629
|
+
.figure, pre, .pseudocode {
|
630
630
|
background-color: #f7f7f7;
|
631
631
|
line-height: 1.6em;
|
632
632
|
padding: 1.5em;
|
@@ -693,7 +693,7 @@ margin-left:-1.5em;
|
|
693
693
|
}
|
694
694
|
|
695
695
|
|
696
|
-
.example
|
696
|
+
.example pre, .example .pseudocode {
|
697
697
|
background: none;
|
698
698
|
}
|
699
699
|
|
@@ -591,6 +591,102 @@ ul, ol {margin-left: 2em;}
|
|
591
591
|
|
592
592
|
#toc-list ol li {list-style-type: none;}
|
593
593
|
|
594
|
+
/* https://github.com/metanorma/metanorma-iso/issues/319 : force a) parentheses for ordered lists */
|
595
|
+
|
596
|
+
ol[type="alphabet"] {
|
597
|
+
counter-reset: alphabet;
|
598
|
+
}
|
599
|
+
ol[type="arabic"] {
|
600
|
+
counter-reset: arabic;
|
601
|
+
}
|
602
|
+
ol[type="roman"] {
|
603
|
+
counter-reset: roman;
|
604
|
+
}
|
605
|
+
ol[type="alphabet_upper"] {
|
606
|
+
counter-reset: alphabet_upper;
|
607
|
+
}
|
608
|
+
ol[type="roman_upper"] {
|
609
|
+
counter-reset: roman_upper;
|
610
|
+
}
|
611
|
+
ol[type="alphabet"] ol[type="alphabet"] {
|
612
|
+
counter-reset: alphabet2;
|
613
|
+
}
|
614
|
+
ol[type="arabic"] ol[type="arabic"] {
|
615
|
+
counter-reset: arabic2;
|
616
|
+
}
|
617
|
+
ol[type="roman"] ol[type="roman"] {
|
618
|
+
counter-reset: roman2;
|
619
|
+
}
|
620
|
+
ol[type="alphabet_upper"] ol[type="alphabet_upper"] {
|
621
|
+
counter-reset: alphabet_upper2;
|
622
|
+
}
|
623
|
+
ol[type="roman_upper"] ol[type="roman_upper"] {
|
624
|
+
counter-reset: roman_upper2;
|
625
|
+
}
|
626
|
+
ol {
|
627
|
+
counter-reset: alphabet;
|
628
|
+
}
|
629
|
+
|
630
|
+
ol > li {
|
631
|
+
list-style: none;
|
632
|
+
position: relative;
|
633
|
+
}
|
634
|
+
ol > li:before {
|
635
|
+
position: absolute;
|
636
|
+
left: -1.4em;
|
637
|
+
}
|
638
|
+
ol[type="roman"] > li:before {
|
639
|
+
left: -2.0em;
|
640
|
+
}
|
641
|
+
ol[type="roman_upper"] > li:before {
|
642
|
+
left: -2.3em;
|
643
|
+
}
|
644
|
+
ol[type="alphabet"] > li:before {
|
645
|
+
counter-increment: alphabet;
|
646
|
+
content: counter(alphabet, lower-alpha)") "
|
647
|
+
}
|
648
|
+
ol[type="arabic"] > li:before {
|
649
|
+
counter-increment: arabic;
|
650
|
+
content: counter(arabic, decimal)") "
|
651
|
+
}
|
652
|
+
ol[type="roman"] > li:before {
|
653
|
+
counter-increment: roman;
|
654
|
+
content: counter(roman, lower-roman)") "
|
655
|
+
}
|
656
|
+
ol[type="alphabet_upper"] > li:before {
|
657
|
+
counter-increment: alphabet_upper;
|
658
|
+
content: counter(alphabet_upper, upper-alpha)") "
|
659
|
+
}
|
660
|
+
ol[type="roman_upper"] > li:before {
|
661
|
+
counter-increment: roman_upper;
|
662
|
+
content: counter(roman_upper, upper-roman)") "
|
663
|
+
}
|
664
|
+
ol > li:before {
|
665
|
+
counter-increment: alphabet;
|
666
|
+
content: counter(alphabet, lower-alpha)") "
|
667
|
+
}
|
668
|
+
ol[type="alphabet"] ol[type="alphabet"] > li:before {
|
669
|
+
counter-increment: alphabet2;
|
670
|
+
content: counter(alphabet2, lower-alpha)") "
|
671
|
+
}
|
672
|
+
ol[type="arabic"] ol[type="arabic"] > li:before {
|
673
|
+
counter-increment: arabic2;
|
674
|
+
content: counter(arabic2, decimal)") "
|
675
|
+
}
|
676
|
+
ol[type="roman"] ol[type="roman"] > li:before {
|
677
|
+
counter-increment: roman2;
|
678
|
+
content: counter(roman2, lower-roman)") "
|
679
|
+
}
|
680
|
+
ol[type="alphabet_upper"] ol[type="alphabet_upper"] > li:before {
|
681
|
+
counter-increment: alphabet_upper2;
|
682
|
+
content: counter(alphabet_upper2, upper-alpha)") "
|
683
|
+
}
|
684
|
+
ol[type="roman_upper"] ol[type="roman_upper"] > li:before {
|
685
|
+
counter-increment: roman_upper2;
|
686
|
+
content: counter(roman_upper2, upper-roman)") "
|
687
|
+
}
|
688
|
+
|
689
|
+
|
594
690
|
/*
|
595
691
|
3.4 Rules
|
596
692
|
*/
|
@@ -615,12 +711,12 @@ margin-left: 2em;
|
|
615
711
|
3.6 Source Code + figures
|
616
712
|
*/
|
617
713
|
|
618
|
-
|
714
|
+
pre {
|
619
715
|
font-family: $monospacefont;
|
620
716
|
font-variant-ligatures: none;
|
621
717
|
}
|
622
718
|
|
623
|
-
.figure,
|
719
|
+
.figure, pre, .pseudocode {
|
624
720
|
background-color: #f7f7f7;
|
625
721
|
line-height: 1.6em;
|
626
722
|
padding: 1.5em;
|
@@ -685,7 +781,7 @@ margin-top:0;
|
|
685
781
|
}
|
686
782
|
|
687
783
|
|
688
|
-
.example
|
784
|
+
.example pre, .example .pseudocode {
|
689
785
|
background: none;
|
690
786
|
}
|
691
787
|
|
@@ -496,7 +496,7 @@ OUTPUT
|
|
496
496
|
:no-isobib:
|
497
497
|
INPUT
|
498
498
|
html = File.read("test.html", encoding: "utf-8")
|
499
|
-
expect(html).to match(%r[
|
499
|
+
expect(html).to match(%r[\bpre[^{]+\{[^{]+font-family: "Courier New", monospace;]m)
|
500
500
|
expect(html).to match(%r[blockquote[^{]+\{[^{]+font-family: "Cambria", serif;]m)
|
501
501
|
expect(html).to match(%r[\.h2Annex[^{]+\{[^{]+font-family: "Cambria", serif;]m)
|
502
502
|
end
|
@@ -511,7 +511,7 @@ OUTPUT
|
|
511
511
|
:no-isobib:
|
512
512
|
INPUT
|
513
513
|
html = File.read("test_alt.html", encoding: "utf-8")
|
514
|
-
expect(html).to match(%r[
|
514
|
+
expect(html).to match(%r[\bpre[^{]+\{[^{]+font-family: "Space Mono", monospace;]m)
|
515
515
|
expect(html).to match(%r[blockquote[^{]+\{[^{]+font-family: "Lato", sans-serif;]m)
|
516
516
|
expect(html).to match(%r[\.h2Annex[^{]+\{[^{]+font-family: "Lato", sans-serif;]m)
|
517
517
|
end
|
@@ -527,7 +527,7 @@ OUTPUT
|
|
527
527
|
:script: Hans
|
528
528
|
INPUT
|
529
529
|
html = File.read("test.html", encoding: "utf-8")
|
530
|
-
expect(html).to match(%r[
|
530
|
+
expect(html).to match(%r[\bpre[^{]+\{[^{]+font-family: "Courier New", monospace;]m)
|
531
531
|
expect(html).to match(%r[blockquote[^{]+\{[^{]+font-family: "SimSun", serif;]m)
|
532
532
|
expect(html).to match(%r[\.h2Annex[^{]+\{[^{]+font-family: "SimHei", sans-serif;]m)
|
533
533
|
end
|
@@ -546,7 +546,7 @@ OUTPUT
|
|
546
546
|
:monospace-font: Andale Mono
|
547
547
|
INPUT
|
548
548
|
html = File.read("test.html", encoding: "utf-8")
|
549
|
-
expect(html).to match(%r[
|
549
|
+
expect(html).to match(%r[\bpre[^{]+\{[^{]+font-family: Andale Mono;]m)
|
550
550
|
expect(html).to match(%r[blockquote[^{]+\{[^{]+font-family: Zapf Chancery;]m)
|
551
551
|
expect(html).to match(%r[\.h2Annex[^{]+\{[^{]+font-family: Comic Sans;]m)
|
552
552
|
end
|
@@ -263,7 +263,7 @@ RSpec.describe Asciidoctor::ISO do
|
|
263
263
|
== Section 1
|
264
264
|
INPUT
|
265
265
|
#{BLANK_HDR}
|
266
|
-
<preface><foreword obligation="informative">
|
266
|
+
<preface><foreword id="_" obligation="informative">
|
267
267
|
<title>Foreword</title>
|
268
268
|
<p id="_">This is a preamble</p>
|
269
269
|
</foreword></preface><sections>
|
@@ -183,7 +183,7 @@ RSpec.describe Asciidoctor::ISO do
|
|
183
183
|
* [[[iso216,ISO 216:2001]]], _Reference_
|
184
184
|
INPUT
|
185
185
|
#{BLANK_HDR}
|
186
|
-
<preface><foreword obligation="informative">
|
186
|
+
<preface><foreword id='_' obligation="informative">
|
187
187
|
<title>Foreword</title>
|
188
188
|
<p id="_">
|
189
189
|
<eref type="inline" bibitemid="iso216" citeas="ISO 216:2001"/>
|
@@ -222,7 +222,7 @@ RSpec.describe Asciidoctor::ISO do
|
|
222
222
|
* [[[iso216,ISO 216]]], _Reference_
|
223
223
|
INPUT
|
224
224
|
#{BLANK_HDR}
|
225
|
-
<preface><foreword obligation="informative">
|
225
|
+
<preface><foreword id='_' obligation="informative">
|
226
226
|
<title>Foreword</title>
|
227
227
|
<p id="_">
|
228
228
|
<eref type="inline" bibitemid="iso216" citeas="ISO 216"><locality type="whole"/><locality type="clause"><referenceFrom>3</referenceFrom></locality><locality type="example"><referenceFrom>9</referenceFrom><referenceTo>11</referenceTo></locality><locality type="locality:prelude"><referenceFrom>33</referenceFrom></locality><locality type="locality:entirety"/>the reference</eref>
|
@@ -260,7 +260,7 @@ RSpec.describe Asciidoctor::ISO do
|
|
260
260
|
INPUT
|
261
261
|
#{BLANK_HDR}
|
262
262
|
<preface>
|
263
|
-
<foreword obligation="informative">
|
263
|
+
<foreword id='_' obligation="informative">
|
264
264
|
<title>Foreword</title>
|
265
265
|
<p id="_">
|
266
266
|
<eref type="inline" bibitemid="iso216" citeas="ISO 216"/>
|
@@ -421,17 +421,17 @@ RSpec.describe Asciidoctor::ISO do
|
|
421
421
|
#{BLANK_HDR}
|
422
422
|
<sections>
|
423
423
|
<table id="_"><thead><tr>
|
424
|
-
<
|
425
|
-
<
|
426
|
-
<
|
424
|
+
<th align="left">a</th>
|
425
|
+
<th align="left">b</th>
|
426
|
+
<th align="left">c</th>
|
427
427
|
</tr><tr>
|
428
|
-
<
|
429
|
-
<
|
430
|
-
<
|
428
|
+
<th align="left">a</th>
|
429
|
+
<th align="left">b</th>
|
430
|
+
<th align="left">c</th>
|
431
431
|
</tr><tr>
|
432
|
-
<
|
433
|
-
<
|
434
|
-
<
|
432
|
+
<th align="left">a</th>
|
433
|
+
<th align="left">b</th>
|
434
|
+
<th align="left">c</th>
|
435
435
|
</tr></thead>
|
436
436
|
<tbody>
|
437
437
|
<tr>
|
@@ -468,13 +468,13 @@ RSpec.describe Asciidoctor::ISO do
|
|
468
468
|
<th align="left">c</th>
|
469
469
|
</tr>
|
470
470
|
<tr>
|
471
|
-
<
|
472
|
-
<
|
473
|
-
<
|
471
|
+
<th align="left">a</th>
|
472
|
+
<th align="left">b</th>
|
473
|
+
<th align="left">c</th>
|
474
474
|
</tr><tr>
|
475
|
-
<
|
476
|
-
<
|
477
|
-
<
|
475
|
+
<th align="left">a</th>
|
476
|
+
<th align="left">b</th>
|
477
|
+
<th align="left">c</th>
|
478
478
|
</tr></thead>
|
479
479
|
<tbody>
|
480
480
|
|
@@ -612,7 +612,7 @@ RSpec.describe Asciidoctor::ISO do
|
|
612
612
|
footnote:[Footnote2]
|
613
613
|
INPUT
|
614
614
|
#{BLANK_HDR}
|
615
|
-
<preface><foreword obligation="informative">
|
615
|
+
<preface><foreword id='_' obligation="informative">
|
616
616
|
<title>Foreword</title>
|
617
617
|
<p id="_"><fn reference="1">
|
618
618
|
<p id="_">Footnote</p>
|
@@ -242,7 +242,7 @@ standardization at the following addresses:</p>
|
|
242
242
|
|
243
243
|
INPUT
|
244
244
|
#{BLANK_HDR.sub(/<boilerplate>/, '<termdocsource bibitemid="iso1234"/><termdocsource bibitemid="iso5678"/><boilerplate>')}
|
245
|
-
<preface><foreword obligation="informative">
|
245
|
+
<preface><foreword id='_' obligation="informative">
|
246
246
|
<title>Foreword</title>
|
247
247
|
<p id="_">Foreword</p>
|
248
248
|
</foreword></preface><sections>
|
@@ -280,7 +280,7 @@ standardization at the following addresses:</p>
|
|
280
280
|
INPUT
|
281
281
|
#{BLANK_HDR}
|
282
282
|
<preface>
|
283
|
-
<foreword obligation='informative'>
|
283
|
+
<foreword id='_' obligation='informative'>
|
284
284
|
<title>Foreword</title>
|
285
285
|
<p id='_'>Foreword</p>
|
286
286
|
</foreword>
|
@@ -325,7 +325,7 @@ standardization at the following addresses:</p>
|
|
325
325
|
|
326
326
|
INPUT
|
327
327
|
#{BLANK_HDR.sub(/<boilerplate>/, '<termdocsource bibitemid="iso1234"/><termdocsource bibitemid="iso5678"/><boilerplate>')}
|
328
|
-
<preface><foreword obligation="informative">
|
328
|
+
<preface><foreword id='_' obligation="informative">
|
329
329
|
<title>Foreword</title>
|
330
330
|
<p id="_">Foreword</p>
|
331
331
|
</foreword></preface><sections>
|
@@ -51,13 +51,13 @@ RSpec.describe Asciidoctor::ISO do
|
|
51
51
|
<table id="_">
|
52
52
|
<name>Table Name</name>
|
53
53
|
<thead><tr>
|
54
|
-
<
|
55
|
-
<
|
56
|
-
<
|
54
|
+
<th align="left">A</th>
|
55
|
+
<th align="left">B</th>
|
56
|
+
<th align="left">C</th>
|
57
57
|
</tr><tr>
|
58
58
|
<th align="left">1</th>
|
59
|
-
<
|
60
|
-
<
|
59
|
+
<th align="left">2</th>
|
60
|
+
<th align="left">3</th>
|
61
61
|
</tr></thead>
|
62
62
|
<tbody>
|
63
63
|
|
@@ -88,13 +88,13 @@ RSpec.describe Asciidoctor::ISO do
|
|
88
88
|
#{BLANK_HDR}
|
89
89
|
<sections>
|
90
90
|
<table id="_"><thead><tr>
|
91
|
-
<
|
92
|
-
<
|
93
|
-
<
|
91
|
+
<th align="left">A</th>
|
92
|
+
<th align="left">B</th>
|
93
|
+
<th align="left">C</th>
|
94
94
|
</tr><tr>
|
95
95
|
<th align="left">1</th>
|
96
|
-
<
|
97
|
-
<
|
96
|
+
<th align="left">2</th>
|
97
|
+
<th align="left">3</th>
|
98
98
|
</tr></thead>
|
99
99
|
<tbody>
|
100
100
|
|
@@ -153,10 +153,10 @@ RSpec.describe Asciidoctor::ISO do
|
|
153
153
|
<stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>w</mi><mi>max</mi></msub></math></stem></th>
|
154
154
|
</tr>
|
155
155
|
<tr>
|
156
|
-
<
|
157
|
-
<
|
158
|
-
<
|
159
|
-
<
|
156
|
+
<th align="left">in husked rice</th>
|
157
|
+
<th align="center">in milled rice (non-glutinous)</th>
|
158
|
+
<th align="center">in husked parboiled rice</th>
|
159
|
+
<th align="center">in milled parboiled rice</th>
|
160
160
|
</tr></thead>
|
161
161
|
<tbody>
|
162
162
|
|
data/spec/isodoc/iso_spec.rb
CHANGED
@@ -14,7 +14,7 @@ RSpec.describe IsoDoc::Iso do
|
|
14
14
|
</iso-standard>
|
15
15
|
INPUT
|
16
16
|
html = File.read("test.html", encoding: "utf-8")
|
17
|
-
expect(html).to match(%r[
|
17
|
+
expect(html).to match(%r[\bpre[^{]+\{[^{]+font-family: "Courier New", monospace;]m)
|
18
18
|
expect(html).to match(%r[blockquote[^{]+\{[^{]+font-family: "Cambria", serif;]m)
|
19
19
|
expect(html).to match(%r[\.h2Annex[^{]+\{[^{]+font-family: "Cambria", serif;]m)
|
20
20
|
end
|
@@ -31,7 +31,7 @@ RSpec.describe IsoDoc::Iso do
|
|
31
31
|
</iso-standard>
|
32
32
|
INPUT
|
33
33
|
html = File.read("test.html", encoding: "utf-8")
|
34
|
-
expect(html).to match(%r[
|
34
|
+
expect(html).to match(%r[\bpre[^{]+\{[^{]+font-family: "Space Mono", monospace;]m)
|
35
35
|
expect(html).to match(%r[blockquote[^{]+\{[^{]+font-family: "Lato", sans-serif;]m)
|
36
36
|
expect(html).to match(%r[\.h2Annex[^{]+\{[^{]+font-family: "Lato", sans-serif;]m)
|
37
37
|
end
|
@@ -48,7 +48,7 @@ RSpec.describe IsoDoc::Iso do
|
|
48
48
|
</iso-standard>
|
49
49
|
INPUT
|
50
50
|
html = File.read("test.html", encoding: "utf-8")
|
51
|
-
expect(html).to match(%r[
|
51
|
+
expect(html).to match(%r[\bpre[^{]+\{[^{]+font-family: "Courier New", monospace;]m)
|
52
52
|
expect(html).to match(%r[blockquote[^{]+\{[^{]+font-family: "SimSun", serif;]m)
|
53
53
|
expect(html).to match(%r[\.h2Annex[^{]+\{[^{]+font-family: "SimHei", sans-serif;]m)
|
54
54
|
end
|
@@ -65,7 +65,7 @@ RSpec.describe IsoDoc::Iso do
|
|
65
65
|
</iso-standard>
|
66
66
|
INPUT
|
67
67
|
html = File.read("test.html", encoding: "utf-8")
|
68
|
-
expect(html).to match(%r[
|
68
|
+
expect(html).to match(%r[\bpre[^{]+\{[^{]+font-family: Andale Mono;]m)
|
69
69
|
expect(html).to match(%r[blockquote[^{]+\{[^{]+font-family: Zapf Chancery;]m)
|
70
70
|
expect(html).to match(%r[\.h2Annex[^{]+\{[^{]+font-family: Comic Sans;]m)
|
71
71
|
end
|
@@ -82,7 +82,7 @@ RSpec.describe IsoDoc::Iso do
|
|
82
82
|
</iso-standard>
|
83
83
|
INPUT
|
84
84
|
html = File.read("test.doc", encoding: "utf-8")
|
85
|
-
expect(html).to match(%r[
|
85
|
+
expect(html).to match(%r[\bpre[^{]+\{[^{]+font-family: "Courier New", monospace;]m)
|
86
86
|
expect(html).to match(%r[Quote[^{]+\{[^{]+font-family: "Cambria", serif;]m)
|
87
87
|
expect(html).to match(%r[\.h2Annex[^{]+\{[^{]+font-family: "Cambria", serif;]m)
|
88
88
|
end
|
@@ -287,30 +287,155 @@ RSpec.describe IsoDoc do
|
|
287
287
|
<div id="A">
|
288
288
|
<h1>1  Clause 4</h1>
|
289
289
|
<a rel="footnote" href="#fn:3" epub:type="footnote" id="fnref:1">
|
290
|
-
<sup>1</sup>
|
290
|
+
<sup>1)</sup>
|
291
291
|
</a>
|
292
292
|
<div id="N">
|
293
293
|
|
294
|
-
<h2>1.1  Introduction to this<a rel="footnote" href="#fn:2" epub:type="footnote" id="fnref:2"><sup>2</sup></a></h2>
|
294
|
+
<h2>1.1  Introduction to this<a rel="footnote" href="#fn:2" epub:type="footnote" id="fnref:2"><sup>2)</sup></a></h2>
|
295
295
|
</div>
|
296
296
|
<div id="O">
|
297
297
|
<h2>1.2  Clause 4.2</h2>
|
298
|
-
<p>A<a rel="footnote" href="#fn:2" epub:type="footnote"><sup>2</sup></a></p>
|
298
|
+
<p>A<a rel="footnote" href="#fn:2" epub:type="footnote"><sup>2)</sup></a></p>
|
299
299
|
</div>
|
300
300
|
</div>
|
301
301
|
<aside id="fn:3" class="footnote">
|
302
302
|
<p id="_ff27c067-2785-4551-96cf-0a73530ff1e6"><a rel="footnote" href="#fn:3" epub:type="footnote">
|
303
|
-
<sup>1</sup>
|
303
|
+
<sup>1)</sup>
|
304
304
|
</a>This is a footnote.</p>
|
305
305
|
<a href="#fnref:1">↩</a></aside>
|
306
306
|
<aside id="fn:2" class="footnote">
|
307
|
-
<p id="_ff27c067-2785-4551-96cf-0a73530ff1e6"><a rel="footnote" href="#fn:2" epub:type="footnote"><sup>2</sup></a>Formerly denoted as 15 % (m/m).</p>
|
307
|
+
<p id="_ff27c067-2785-4551-96cf-0a73530ff1e6"><a rel="footnote" href="#fn:2" epub:type="footnote"><sup>2)</sup></a>Formerly denoted as 15 % (m/m).</p>
|
308
308
|
<a href="#fnref:2">↩</a></aside>
|
309
309
|
|
310
310
|
</main>
|
311
311
|
OUTPUT
|
312
312
|
end
|
313
313
|
|
314
|
+
it "renders footnote numbers in Word" do
|
315
|
+
FileUtils.rm_f "test.doc"
|
316
|
+
IsoDoc::Iso::WordConvert.new({wordstylesheet: "spec/assets/word.css", htmlstylesheet: "spec/assets/html.css", wordintropage: "spec/assets/wordintro.html"}).convert("test", <<~"INPUT", false)
|
317
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
318
|
+
<sections>
|
319
|
+
<clause id="A" inline-header="false" obligation="normative"><title>Clause 4</title><fn reference="3">
|
320
|
+
<p id="_ff27c067-2785-4551-96cf-0a73530ff1e6">This is a footnote.</p>
|
321
|
+
</fn><clause id="N" inline-header="false" obligation="normative">
|
322
|
+
|
323
|
+
<title>Introduction to this<fn reference="2">
|
324
|
+
<p id="_ff27c067-2785-4551-96cf-0a73530ff1e6">Formerly denoted as 15 % (m/m).</p>
|
325
|
+
</fn></title>
|
326
|
+
</clause>
|
327
|
+
<clause id="O" inline-header="false" obligation="normative">
|
328
|
+
<title>Clause 4.2</title>
|
329
|
+
<p>A<fn reference="1">
|
330
|
+
<p id="_ff27c067-2785-4551-96cf-0a73530ff1e6">Formerly denoted as 15 % (m/m).</p>
|
331
|
+
</fn></p>
|
332
|
+
</clause></clause>
|
333
|
+
</sections>
|
334
|
+
</iso-standard>
|
335
|
+
INPUT
|
336
|
+
html = File.read("test.doc", encoding: "UTF-8").sub(/^.*<div class="WordSection3"/m, '<body xmlns:epub="epub"><div class="WordSection3"').
|
337
|
+
sub(%r{</body>.*$}m, "</body>").gsub(/mso-bookmark:_Ref\d+/, "mso-bookmark:_Ref")
|
338
|
+
expect(xmlpp(html)).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
339
|
+
<body xmlns:epub='epub'>
|
340
|
+
<div class='WordSection3'>
|
341
|
+
<p class='zzSTDTitle1'/>
|
342
|
+
<div>
|
343
|
+
<a name='A' id='A'/>
|
344
|
+
<h1>
|
345
|
+
1
|
346
|
+
<span style='mso-tab-count:1'>  </span>
|
347
|
+
Clause 4
|
348
|
+
</h1>
|
349
|
+
<span style='mso-bookmark:_Ref'>
|
350
|
+
<a href='#_ftn1' epub:type='footnote' style='mso-footnote-id:ftn1' name='_ftnref1' title='' id='_ftnref1'>
|
351
|
+
<span class='MsoFootnoteReference'>
|
352
|
+
<span style='mso-special-character:footnote'/>
|
353
|
+
</span>
|
354
|
+
<span class='MsoFootnoteReference'>)</span>
|
355
|
+
</a>
|
356
|
+
</span>
|
357
|
+
<div>
|
358
|
+
<a name='N' id='N'/>
|
359
|
+
<h2>
|
360
|
+
1.1
|
361
|
+
<span style='mso-tab-count:1'>  </span>
|
362
|
+
Introduction to this
|
363
|
+
<span style='mso-bookmark:_Ref'>
|
364
|
+
<a href='#_ftn2' epub:type='footnote' style='mso-footnote-id:ftn2' name='_ftnref2' title='' id='_ftnref2'>
|
365
|
+
<span class='MsoFootnoteReference'>
|
366
|
+
<span style='mso-special-character:footnote'/>
|
367
|
+
</span>
|
368
|
+
<span class='MsoFootnoteReference'>)</span>
|
369
|
+
</a>
|
370
|
+
</span>
|
371
|
+
</h2>
|
372
|
+
</div>
|
373
|
+
<div>
|
374
|
+
<a name='O' id='O'/>
|
375
|
+
<h2>
|
376
|
+
1.2
|
377
|
+
<span style='mso-tab-count:1'>  </span>
|
378
|
+
Clause 4.2
|
379
|
+
</h2>
|
380
|
+
<p class='MsoNormal'>
|
381
|
+
A
|
382
|
+
<span style='mso-bookmark:_Ref'>
|
383
|
+
<a href='#_ftn3' epub:type='footnote' style='mso-footnote-id:ftn3' name='_ftnref3' title='' id='_ftnref3'>
|
384
|
+
<span class='MsoFootnoteReference'>
|
385
|
+
<span style='mso-special-character:footnote'/>
|
386
|
+
</span>
|
387
|
+
<span class='MsoFootnoteReference'>)</span>
|
388
|
+
</a>
|
389
|
+
</span>
|
390
|
+
</p>
|
391
|
+
</div>
|
392
|
+
</div>
|
393
|
+
</div>
|
394
|
+
<br clear='all' style='page-break-before:left;mso-break-type:section-break'/>
|
395
|
+
<div class='colophon'/>
|
396
|
+
<div style='mso-element:footnote-list'>
|
397
|
+
<div style='mso-element:footnote' id='ftn1'>
|
398
|
+
<p class='MsoFootnoteText'>
|
399
|
+
<a name='_ff27c067-2785-4551-96cf-0a73530ff1e6' id='_ff27c067-2785-4551-96cf-0a73530ff1e6'/>
|
400
|
+
<a style='mso-footnote-id:ftn1' href='#_ftn1' name='_ftnref1' title='' id='_ftnref1'>
|
401
|
+
<span class='MsoFootnoteReference'>
|
402
|
+
<span style='mso-special-character:footnote'/>
|
403
|
+
</span>
|
404
|
+
<span class='MsoFootnoteReference'>)</span>
|
405
|
+
</a>
|
406
|
+
This is a footnote.
|
407
|
+
</p>
|
408
|
+
</div>
|
409
|
+
<div style='mso-element:footnote' id='ftn2'>
|
410
|
+
<p class='MsoFootnoteText'>
|
411
|
+
<a name='_ff27c067-2785-4551-96cf-0a73530ff1e6' id='_ff27c067-2785-4551-96cf-0a73530ff1e6'/>
|
412
|
+
<a style='mso-footnote-id:ftn2' href='#_ftn2' name='_ftnref2' title='' id='_ftnref2'>
|
413
|
+
<span class='MsoFootnoteReference'>
|
414
|
+
<span style='mso-special-character:footnote'/>
|
415
|
+
</span>
|
416
|
+
<span class='MsoFootnoteReference'>)</span>
|
417
|
+
</a>
|
418
|
+
Formerly denoted as 15 % (m/m).
|
419
|
+
</p>
|
420
|
+
</div>
|
421
|
+
<div style='mso-element:footnote' id='ftn3'>
|
422
|
+
<p class='MsoFootnoteText'>
|
423
|
+
<a name='_ff27c067-2785-4551-96cf-0a73530ff1e6' id='_ff27c067-2785-4551-96cf-0a73530ff1e6'/>
|
424
|
+
<a style='mso-footnote-id:ftn3' href='#_ftn3' name='_ftnref3' title='' id='_ftnref3'>
|
425
|
+
<span class='MsoFootnoteReference'>
|
426
|
+
<span style='mso-special-character:footnote'/>
|
427
|
+
</span>
|
428
|
+
<span class='MsoFootnoteReference'>)</span>
|
429
|
+
</a>
|
430
|
+
Formerly denoted as 15 % (m/m).
|
431
|
+
</p>
|
432
|
+
</div>
|
433
|
+
</div>
|
434
|
+
</body>
|
435
|
+
OUTPUT
|
436
|
+
end
|
437
|
+
|
438
|
+
|
314
439
|
it "moves images in HTML" do
|
315
440
|
FileUtils.rm_f "test.html"
|
316
441
|
FileUtils.rm_rf "_images"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metanorma-iso
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.19
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-03-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ruby-jing
|