metanorma-iso 2.1.1 → 2.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/html2doc/lists.rb +145 -10
- data/lib/isodoc/iso/base_convert.rb +10 -0
- data/lib/isodoc/iso/html/html_iso_titlepage.html +2 -0
- data/lib/isodoc/iso/html/isodoc-dis.css +173 -257
- data/lib/isodoc/iso/html/isodoc-dis.scss +173 -249
- data/lib/isodoc/iso/html/isodoc.css +38 -13
- data/lib/isodoc/iso/html/isodoc.scss +38 -12
- data/lib/isodoc/iso/html/style-human.css +14 -1
- data/lib/isodoc/iso/html/style-human.scss +10 -1
- data/lib/isodoc/iso/html/style-iso.css +35 -23
- data/lib/isodoc/iso/html/style-iso.scss +31 -23
- data/lib/isodoc/iso/html/word_iso_intro-dis.html +1 -6
- data/lib/isodoc/iso/html/word_iso_titlepage-dis.html +24 -13
- data/lib/isodoc/iso/html/word_iso_titlepage-prf.html +58 -0
- data/lib/isodoc/iso/html/word_iso_titlepage.html +6 -2
- data/lib/isodoc/iso/html_convert.rb +5 -0
- data/lib/isodoc/iso/i18n-en.yaml +32 -4
- data/lib/isodoc/iso/i18n-fr.yaml +29 -3
- data/lib/isodoc/iso/i18n-ru.yaml +32 -4
- data/lib/isodoc/iso/i18n-zh-Hans.yaml +32 -3
- data/lib/isodoc/iso/i18n.rb +1 -1
- data/lib/isodoc/iso/iso.amendment.xsl +750 -307
- data/lib/isodoc/iso/iso.international-standard.xsl +750 -307
- data/lib/isodoc/iso/metadata.rb +63 -63
- data/lib/isodoc/iso/presentation_bibdata.rb +74 -0
- data/lib/isodoc/iso/presentation_xml_convert.rb +15 -4
- data/lib/isodoc/iso/presentation_xref.rb +8 -2
- data/lib/isodoc/iso/sections.rb +1 -1
- data/lib/isodoc/iso/word_cleanup.rb +3 -0
- data/lib/isodoc/iso/word_convert.rb +6 -3
- data/lib/isodoc/iso/word_dis_cleanup.rb +243 -0
- data/lib/isodoc/iso/word_dis_convert.rb +47 -108
- data/lib/isodoc/iso/xref.rb +34 -6
- data/lib/metanorma/iso/base.rb +14 -1
- data/lib/metanorma/iso/biblio.rng +134 -39
- data/lib/metanorma/iso/boilerplate-fr.xml +3 -0
- data/lib/metanorma/iso/boilerplate-ru.xml +3 -0
- data/lib/metanorma/iso/boilerplate.xml +3 -0
- data/lib/metanorma/iso/cleanup.rb +53 -13
- data/lib/metanorma/iso/front.rb +38 -6
- data/lib/metanorma/iso/front_id.rb +2 -0
- data/lib/metanorma/iso/isodoc.rng +32 -0
- data/lib/metanorma/iso/isostandard.rng +32 -12
- data/lib/metanorma/iso/validate_section.rb +0 -12
- data/lib/metanorma/iso/version.rb +1 -1
- data/spec/isodoc/amd_spec.rb +4 -30
- data/spec/isodoc/blocks_spec.rb +499 -2
- data/spec/isodoc/i18n_spec.rb +145 -80
- data/spec/isodoc/iso_spec.rb +50 -169
- data/spec/isodoc/metadata_spec.rb +223 -83
- data/spec/isodoc/postproc_spec.rb +41 -5
- data/spec/isodoc/section_spec.rb +9 -9
- data/spec/isodoc/word_dis_spec.rb +1332 -146
- data/spec/isodoc/xref_spec.rb +87 -13
- data/spec/metanorma/amd_spec.rb +39 -23
- data/spec/metanorma/base_spec.rb +174 -44
- data/spec/metanorma/blocks_spec.rb +21 -0
- data/spec/metanorma/cleanup_spec.rb +196 -196
- data/spec/metanorma/lists_spec.rb +2 -2
- data/spec/metanorma/section_spec.rb +2 -2
- data/spec/metanorma/validate_spec.rb +8 -19
- data/spec/spec_helper.rb +10 -7
- data/spec/vcr_cassettes/withdrawn_iso.yml +30 -30
- metadata +6 -8
- data/docs/asciiiso-syntax.adoc +0 -307
- data/docs/guidance.adoc +0 -487
- data/docs/navigation.adoc +0 -23
- data/docs/quickstart.adoc +0 -179
- data/lib/isodoc/iso/presentation_inline.rb +0 -90
data/spec/isodoc/blocks_spec.rb
CHANGED
@@ -1,6 +1,183 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
|
3
3
|
RSpec.describe IsoDoc do
|
4
|
+
it "processes examples" do
|
5
|
+
input = <<~INPUT
|
6
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
7
|
+
<preface>
|
8
|
+
<foreword>
|
9
|
+
<example id="samplecode">
|
10
|
+
<name>Title</name>
|
11
|
+
<p>Hello</p>
|
12
|
+
</example>
|
13
|
+
</foreword>
|
14
|
+
</preface>
|
15
|
+
</iso-standard>
|
16
|
+
INPUT
|
17
|
+
presxml = <<~OUTPUT
|
18
|
+
<?xml version='1.0'?>
|
19
|
+
<iso-standard type="presentation" xmlns="http://riboseinc.com/isoxml">
|
20
|
+
<preface>
|
21
|
+
<foreword displayorder="1">
|
22
|
+
<example id="samplecode">
|
23
|
+
<name>EXAMPLE — Title</name>
|
24
|
+
<p>Hello</p>
|
25
|
+
</example>
|
26
|
+
</foreword>
|
27
|
+
</preface>
|
28
|
+
</iso-standard>
|
29
|
+
OUTPUT
|
30
|
+
|
31
|
+
html = <<~OUTPUT
|
32
|
+
#{HTML_HDR}
|
33
|
+
<br/>
|
34
|
+
<div>
|
35
|
+
<h1 class="ForewordTitle">Foreword</h1>
|
36
|
+
<div id="samplecode" class="example">
|
37
|
+
<p><span class="example_label">EXAMPLE — Title</span>  Hello</p>
|
38
|
+
</div>
|
39
|
+
</div>
|
40
|
+
<p class="zzSTDTitle1"/>
|
41
|
+
</div>
|
42
|
+
</body>
|
43
|
+
</html>
|
44
|
+
OUTPUT
|
45
|
+
|
46
|
+
word = <<~OUTPUT
|
47
|
+
<body lang="EN-US" link="blue" vlink="#954F72">
|
48
|
+
<div class="WordSection1">
|
49
|
+
<p> </p>
|
50
|
+
</div>
|
51
|
+
<p>
|
52
|
+
<br clear="all" class="section"/>
|
53
|
+
</p>
|
54
|
+
<div class="WordSection2">
|
55
|
+
<p>
|
56
|
+
<br clear="all" style="mso-special-character:line-break;page-break-before:always"/>
|
57
|
+
</p>
|
58
|
+
<div>
|
59
|
+
<h1 class="ForewordTitle">Foreword</h1>
|
60
|
+
<div id="samplecode" class="example">
|
61
|
+
<p><span class="example_label">EXAMPLE — Title</span><span style="mso-tab-count:1">  </span>Hello</p>
|
62
|
+
</div>
|
63
|
+
</div>
|
64
|
+
<p> </p>
|
65
|
+
</div>
|
66
|
+
<p>
|
67
|
+
<br clear="all" class="section"/>
|
68
|
+
</p>
|
69
|
+
<div class="WordSection3">
|
70
|
+
<p class="zzSTDTitle1"/>
|
71
|
+
</div>
|
72
|
+
<br clear="all" style="page-break-before:left;mso-break-type:section-break"/>
|
73
|
+
<div class="colophon"/>
|
74
|
+
</body>
|
75
|
+
OUTPUT
|
76
|
+
expect(IsoDoc::Iso::PresentationXMLConvert.new({})
|
77
|
+
.convert("test", input, true)).to be_equivalent_to xmlpp(presxml)
|
78
|
+
expect(IsoDoc::Iso::HtmlConvert.new({})
|
79
|
+
.convert("test", presxml, true)).to be_equivalent_to xmlpp(html)
|
80
|
+
output = IsoDoc::Iso::WordConvert.new({}).convert("test", presxml, true)
|
81
|
+
expect(xmlpp(output
|
82
|
+
.sub(/^.*<body/m, "<body").sub(%r{</body>.*$}m, "</body>")))
|
83
|
+
.to be_equivalent_to xmlpp(word)
|
84
|
+
end
|
85
|
+
|
86
|
+
it "processes sequences of examples" do
|
87
|
+
input = <<~INPUT
|
88
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
89
|
+
<preface>
|
90
|
+
<foreword>
|
91
|
+
<example id="samplecode">
|
92
|
+
<quote>Hello</quote>
|
93
|
+
</example>
|
94
|
+
<example id="samplecode2">
|
95
|
+
<name>Title</name>
|
96
|
+
<p>Hello</p>
|
97
|
+
</example>
|
98
|
+
</foreword>
|
99
|
+
</preface>
|
100
|
+
</iso-standard>
|
101
|
+
INPUT
|
102
|
+
presxml = <<~OUTPUT
|
103
|
+
<?xml version='1.0'?>
|
104
|
+
<iso-standard type="presentation" xmlns="http://riboseinc.com/isoxml">
|
105
|
+
<preface>
|
106
|
+
<foreword displayorder="1">
|
107
|
+
<example id="samplecode">
|
108
|
+
<name>EXAMPLE 1</name>
|
109
|
+
<quote>Hello</quote>
|
110
|
+
</example>
|
111
|
+
<example id="samplecode2">
|
112
|
+
<name>EXAMPLE 2 — Title</name>
|
113
|
+
<p>Hello</p>
|
114
|
+
</example>
|
115
|
+
</foreword>
|
116
|
+
</preface>
|
117
|
+
</iso-standard>
|
118
|
+
OUTPUT
|
119
|
+
html = <<~OUTPUT
|
120
|
+
#{HTML_HDR}
|
121
|
+
<br/>
|
122
|
+
<div>
|
123
|
+
<h1 class="ForewordTitle">Foreword</h1>
|
124
|
+
<div id="samplecode" class="example">
|
125
|
+
<p><span class="example_label">EXAMPLE 1</span>  </p>
|
126
|
+
<div class="Quote">Hello</div>
|
127
|
+
</div>
|
128
|
+
<div id="samplecode2" class="example">
|
129
|
+
<p><span class="example_label">EXAMPLE 2 — Title</span>  Hello</p>
|
130
|
+
</div>
|
131
|
+
</div>
|
132
|
+
<p class="zzSTDTitle1"/>
|
133
|
+
</div>
|
134
|
+
</body>
|
135
|
+
</html>
|
136
|
+
OUTPUT
|
137
|
+
word = <<~OUTPUT
|
138
|
+
<body lang="EN-US" link="blue" vlink="#954F72">
|
139
|
+
<div class="WordSection1">
|
140
|
+
<p> </p>
|
141
|
+
</div>
|
142
|
+
<p>
|
143
|
+
<br clear="all" class="section"/>
|
144
|
+
</p>
|
145
|
+
<div class="WordSection2">
|
146
|
+
<p>
|
147
|
+
<br clear="all" style="mso-special-character:line-break;page-break-before:always"/>
|
148
|
+
</p>
|
149
|
+
<div>
|
150
|
+
<h1 class="ForewordTitle">Foreword</h1>
|
151
|
+
<div id="samplecode" class="example">
|
152
|
+
<p><span class="example_label">EXAMPLE 1</span><span style="mso-tab-count:1">  </span></p>
|
153
|
+
<div class="Quote">Hello</div>
|
154
|
+
</div>
|
155
|
+
<div id="samplecode2" class="example">
|
156
|
+
<p><span class="example_label">EXAMPLE 2 — Title</span><span style="mso-tab-count:1">  </span>Hello</p>
|
157
|
+
</div>
|
158
|
+
</div>
|
159
|
+
<p> </p>
|
160
|
+
</div>
|
161
|
+
<p>
|
162
|
+
<br clear="all" class="section"/>
|
163
|
+
</p>
|
164
|
+
<div class="WordSection3">
|
165
|
+
<p class="zzSTDTitle1"/>
|
166
|
+
</div>
|
167
|
+
<br clear="all" style="page-break-before:left;mso-break-type:section-break"/>
|
168
|
+
<div class="colophon"/>
|
169
|
+
</body>
|
170
|
+
OUTPUT
|
171
|
+
expect(IsoDoc::Iso::PresentationXMLConvert.new({})
|
172
|
+
.convert("test", input, true)).to be_equivalent_to xmlpp(presxml)
|
173
|
+
expect(IsoDoc::Iso::HtmlConvert.new({})
|
174
|
+
.convert("test", presxml, true)).to be_equivalent_to xmlpp(html)
|
175
|
+
output = IsoDoc::Iso::WordConvert.new({}).convert("test", presxml, true)
|
176
|
+
expect(xmlpp(output
|
177
|
+
.sub(/^.*<body/m, "<body").sub(%r{</body>.*$}m, "</body>")))
|
178
|
+
.to be_equivalent_to xmlpp(word)
|
179
|
+
end
|
180
|
+
|
4
181
|
it "processes admonitions" do
|
5
182
|
input = <<~INPUT
|
6
183
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
@@ -105,6 +282,75 @@ RSpec.describe IsoDoc do
|
|
105
282
|
.to be_equivalent_to xmlpp(output)
|
106
283
|
end
|
107
284
|
|
285
|
+
it "processes editorial notes" do
|
286
|
+
input = <<~INPUT
|
287
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
288
|
+
<preface><foreword>
|
289
|
+
<admonition id="_70234f78-64e5-4dfc-8b6f-f3f037348b6a" type="editorial">
|
290
|
+
<p id="_e94663cc-2473-4ccc-9a72-983a74d989f2">Only use paddy or parboiled rice for the determination of husked rice yield.</p>
|
291
|
+
<p id="_e94663cc-2473-4ccc-9a72-983a74d989f3">Para 2.</p>
|
292
|
+
</admonition>
|
293
|
+
</foreword></preface>
|
294
|
+
</iso-standard>
|
295
|
+
INPUT
|
296
|
+
presxml = <<~INPUT
|
297
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml" type='presentation'>
|
298
|
+
<preface><foreword displayorder="1">
|
299
|
+
<admonition id="_70234f78-64e5-4dfc-8b6f-f3f037348b6a" type="editorial">
|
300
|
+
<p id='_e94663cc-2473-4ccc-9a72-983a74d989f2'>EDITORIAL NOTE —
|
301
|
+
Only use paddy or parboiled rice for the
|
302
|
+
determination of husked rice yield.
|
303
|
+
</p>
|
304
|
+
<p id="_e94663cc-2473-4ccc-9a72-983a74d989f3">Para 2.</p>
|
305
|
+
</admonition>
|
306
|
+
</foreword></preface>
|
307
|
+
</iso-standard>
|
308
|
+
INPUT
|
309
|
+
html = <<~OUTPUT
|
310
|
+
#{HTML_HDR}
|
311
|
+
<br/>
|
312
|
+
<div>
|
313
|
+
<h1 class='ForewordTitle'>Foreword</h1>
|
314
|
+
<div id='_70234f78-64e5-4dfc-8b6f-f3f037348b6a' class='zzHelp'>
|
315
|
+
<p>EDITORIAL NOTE —
|
316
|
+
Only use paddy or parboiled rice for the
|
317
|
+
determination of husked rice yield.
|
318
|
+
</p>
|
319
|
+
<p id='_e94663cc-2473-4ccc-9a72-983a74d989f3'>Para 2.</p>
|
320
|
+
</div>
|
321
|
+
</div>
|
322
|
+
<p class='zzSTDTitle1'/>
|
323
|
+
</div>
|
324
|
+
</body>
|
325
|
+
</html>
|
326
|
+
OUTPUT
|
327
|
+
word = <<~OUTPUT
|
328
|
+
<div class='WordSection2'>
|
329
|
+
<p>
|
330
|
+
<br clear='all' style='mso-special-character:line-break;page-break-before:always'/>
|
331
|
+
</p>
|
332
|
+
<div>
|
333
|
+
<h1 class='ForewordTitle'>Foreword</h1>
|
334
|
+
<div id='_70234f78-64e5-4dfc-8b6f-f3f037348b6a' class='zzHelp'>
|
335
|
+
<p>EDITORIAL NOTE — Only use paddy or parboiled rice for the determination of husked rice yield. </p>
|
336
|
+
<p class='ForewordText' id='_e94663cc-2473-4ccc-9a72-983a74d989f3'>Para 2.</p>
|
337
|
+
</div>
|
338
|
+
</div>
|
339
|
+
<p> </p>
|
340
|
+
</div>
|
341
|
+
OUTPUT
|
342
|
+
expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({})
|
343
|
+
.convert("test", input, true)))
|
344
|
+
.to be_equivalent_to xmlpp(presxml)
|
345
|
+
expect(xmlpp(IsoDoc::Iso::HtmlConvert.new({})
|
346
|
+
.convert("test", presxml, true)))
|
347
|
+
.to be_equivalent_to xmlpp(html)
|
348
|
+
expect(xmlpp(Nokogiri::XML(IsoDoc::Iso::WordConvert.new({})
|
349
|
+
.convert("test", presxml, true))
|
350
|
+
.at("//div[@class = 'WordSection2']").to_xml))
|
351
|
+
.to be_equivalent_to xmlpp(word)
|
352
|
+
end
|
353
|
+
|
108
354
|
it "renders figures" do
|
109
355
|
input = <<~INPUT
|
110
356
|
<iso-standard xmlns='http://riboseinc.com/isoxml'>
|
@@ -618,8 +864,8 @@ RSpec.describe IsoDoc do
|
|
618
864
|
end
|
619
865
|
|
620
866
|
it "processes formulae with single definition list entry" do
|
621
|
-
output = IsoDoc::Iso::HtmlConvert.new({})
|
622
|
-
|
867
|
+
output = IsoDoc::Iso::HtmlConvert.new({})
|
868
|
+
.convert("test", <<~"INPUT", true)
|
623
869
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
624
870
|
<preface>
|
625
871
|
<foreword>
|
@@ -674,4 +920,255 @@ RSpec.describe IsoDoc do
|
|
674
920
|
</html>
|
675
921
|
OUTPUT
|
676
922
|
end
|
923
|
+
|
924
|
+
it "adds ordered list classes for HTML" do
|
925
|
+
input = <<~INPUT
|
926
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
927
|
+
<preface><foreword>
|
928
|
+
<ol>
|
929
|
+
<li><p>A</p></li>
|
930
|
+
<li><p>B</p></li>
|
931
|
+
<li><ol>
|
932
|
+
<li>C</li>
|
933
|
+
<li>D</li>
|
934
|
+
<li><ol>
|
935
|
+
<li>E</li>
|
936
|
+
<li>F</li>
|
937
|
+
<li><ol>
|
938
|
+
<li>G</li>
|
939
|
+
<li>H</li>
|
940
|
+
<li><ol>
|
941
|
+
<li>I</li>
|
942
|
+
<li>J</li>
|
943
|
+
<li><ol>
|
944
|
+
<li>K</li>
|
945
|
+
<li>L</li>
|
946
|
+
<li>M</li>
|
947
|
+
</ol></li>
|
948
|
+
<li>N</li>
|
949
|
+
</ol></li>
|
950
|
+
<li>O</li>
|
951
|
+
</ol></li>
|
952
|
+
<li>P</li>
|
953
|
+
</ol></li>
|
954
|
+
<li>Q</li>
|
955
|
+
</ol></li>
|
956
|
+
<li>R</li>
|
957
|
+
</ol>
|
958
|
+
</foreword></preface>
|
959
|
+
</iso-standard>
|
960
|
+
INPUT
|
961
|
+
presxml = <<~INPUT
|
962
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type='presentation'>
|
963
|
+
<preface>
|
964
|
+
<foreword displayorder='1'>
|
965
|
+
<ol type='alphabet'>
|
966
|
+
<li>
|
967
|
+
<p>A</p>
|
968
|
+
</li>
|
969
|
+
<li>
|
970
|
+
<p>B</p>
|
971
|
+
</li>
|
972
|
+
<li>
|
973
|
+
<ol type='arabic'>
|
974
|
+
<li>C</li>
|
975
|
+
<li>D</li>
|
976
|
+
<li>
|
977
|
+
<ol type='roman'>
|
978
|
+
<li>E</li>
|
979
|
+
<li>F</li>
|
980
|
+
<li>
|
981
|
+
<ol type='alphabet_upper'>
|
982
|
+
<li>G</li>
|
983
|
+
<li>H</li>
|
984
|
+
<li>
|
985
|
+
<ol type='roman_upper'>
|
986
|
+
<li>I</li>
|
987
|
+
<li>J</li>
|
988
|
+
<li>
|
989
|
+
<ol type='alphabet'>
|
990
|
+
<li>K</li>
|
991
|
+
<li>L</li>
|
992
|
+
<li>M</li>
|
993
|
+
</ol>
|
994
|
+
</li>
|
995
|
+
<li>N</li>
|
996
|
+
</ol>
|
997
|
+
</li>
|
998
|
+
<li>O</li>
|
999
|
+
</ol>
|
1000
|
+
</li>
|
1001
|
+
<li>P</li>
|
1002
|
+
</ol>
|
1003
|
+
</li>
|
1004
|
+
<li>Q</li>
|
1005
|
+
</ol>
|
1006
|
+
</li>
|
1007
|
+
<li>R</li>
|
1008
|
+
</ol>
|
1009
|
+
</foreword>
|
1010
|
+
</preface>
|
1011
|
+
</iso-standard>
|
1012
|
+
INPUT
|
1013
|
+
html = <<~OUTPUT
|
1014
|
+
#{HTML_HDR}
|
1015
|
+
<br/>
|
1016
|
+
<div>
|
1017
|
+
<h1 class='ForewordTitle'>Foreword</h1>
|
1018
|
+
<ol type='a' class='alphabet'>
|
1019
|
+
<li>
|
1020
|
+
<p>A</p>
|
1021
|
+
</li>
|
1022
|
+
<li>
|
1023
|
+
<p>B</p>
|
1024
|
+
</li>
|
1025
|
+
<li>
|
1026
|
+
<ol type='1' class='arabic'>
|
1027
|
+
<li>C</li>
|
1028
|
+
<li>D</li>
|
1029
|
+
<li>
|
1030
|
+
<ol type='i' class='roman'>
|
1031
|
+
<li>E</li>
|
1032
|
+
<li>F</li>
|
1033
|
+
<li>
|
1034
|
+
<ol type='A' class='alphabet_upper'>
|
1035
|
+
<li>G</li>
|
1036
|
+
<li>H</li>
|
1037
|
+
<li>
|
1038
|
+
<ol type='I' class='roman_upper'>
|
1039
|
+
<li>I</li>
|
1040
|
+
<li>J</li>
|
1041
|
+
<li>
|
1042
|
+
<ol type='a' class='alphabet'>
|
1043
|
+
<li>K</li>
|
1044
|
+
<li>L</li>
|
1045
|
+
<li>M</li>
|
1046
|
+
</ol>
|
1047
|
+
</li>
|
1048
|
+
<li>N</li>
|
1049
|
+
</ol>
|
1050
|
+
</li>
|
1051
|
+
<li>O</li>
|
1052
|
+
</ol>
|
1053
|
+
</li>
|
1054
|
+
<li>P</li>
|
1055
|
+
</ol>
|
1056
|
+
</li>
|
1057
|
+
<li>Q</li>
|
1058
|
+
</ol>
|
1059
|
+
</li>
|
1060
|
+
<li>R</li>
|
1061
|
+
</ol>
|
1062
|
+
</div>
|
1063
|
+
<p class='zzSTDTitle1'/>
|
1064
|
+
</div>
|
1065
|
+
</body>
|
1066
|
+
</html>
|
1067
|
+
OUTPUT
|
1068
|
+
expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({})
|
1069
|
+
.convert("test", input, true)))
|
1070
|
+
.to be_equivalent_to xmlpp(presxml)
|
1071
|
+
expect(xmlpp(IsoDoc::Iso::HtmlConvert.new({})
|
1072
|
+
.convert("test", presxml, true)))
|
1073
|
+
.to be_equivalent_to xmlpp(html)
|
1074
|
+
end
|
1075
|
+
|
1076
|
+
it "processes ordered lists with start" do
|
1077
|
+
input = <<~INPUT
|
1078
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
1079
|
+
<preface><foreword>
|
1080
|
+
<ol start="4">
|
1081
|
+
<li>List</li>
|
1082
|
+
</ol>
|
1083
|
+
</foreword></preface>
|
1084
|
+
</iso-standard>
|
1085
|
+
INPUT
|
1086
|
+
presxml = <<~INPUT
|
1087
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml" type='presentation'>
|
1088
|
+
<preface>
|
1089
|
+
<foreword displayorder='1'>
|
1090
|
+
<ol start='4' type='alphabet'>
|
1091
|
+
<li>List</li>
|
1092
|
+
</ol>
|
1093
|
+
</foreword>
|
1094
|
+
</preface>
|
1095
|
+
</iso-standard>
|
1096
|
+
INPUT
|
1097
|
+
html = <<~OUTPUT
|
1098
|
+
#{HTML_HDR}
|
1099
|
+
<br/>
|
1100
|
+
<div>
|
1101
|
+
<h1 class='ForewordTitle'>Foreword</h1>
|
1102
|
+
<ol type='a' start='4' class='alphabet'>
|
1103
|
+
<li>List</li>
|
1104
|
+
</ol>
|
1105
|
+
</div>
|
1106
|
+
<p class='zzSTDTitle1'/>
|
1107
|
+
</div>
|
1108
|
+
</body>
|
1109
|
+
</html>
|
1110
|
+
OUTPUT
|
1111
|
+
word = <<~OUTPUT
|
1112
|
+
<div class='WordSection2'>
|
1113
|
+
<p>
|
1114
|
+
<br clear='all' style='mso-special-character:line-break;page-break-before:always'/>
|
1115
|
+
</p>
|
1116
|
+
<div>
|
1117
|
+
<h1 class='ForewordTitle'>Foreword</h1>
|
1118
|
+
<ol type='a' start='4'>
|
1119
|
+
<li>List</li>
|
1120
|
+
</ol>
|
1121
|
+
</div>
|
1122
|
+
<p> </p>
|
1123
|
+
</div>
|
1124
|
+
OUTPUT
|
1125
|
+
|
1126
|
+
expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({})
|
1127
|
+
.convert("test", input, true)))
|
1128
|
+
.to be_equivalent_to xmlpp(presxml)
|
1129
|
+
expect(xmlpp(IsoDoc::Iso::HtmlConvert.new({})
|
1130
|
+
.convert("test", presxml, true)))
|
1131
|
+
.to be_equivalent_to xmlpp(html)
|
1132
|
+
expect(xmlpp(Nokogiri::XML(IsoDoc::Iso::WordConvert.new({})
|
1133
|
+
.convert("test", presxml, true))
|
1134
|
+
.at("//div[@class = 'WordSection2']").to_xml))
|
1135
|
+
.to be_equivalent_to xmlpp(word)
|
1136
|
+
end
|
1137
|
+
|
1138
|
+
it "ignores intervening ul in numbering ol" do
|
1139
|
+
input = <<~INPUT
|
1140
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
1141
|
+
<preface><foreword>
|
1142
|
+
<ul>
|
1143
|
+
<li>A</li>
|
1144
|
+
<li>
|
1145
|
+
<ol>
|
1146
|
+
<li>List</li>
|
1147
|
+
</ol>
|
1148
|
+
</li>
|
1149
|
+
</ul>
|
1150
|
+
</foreword></preface>
|
1151
|
+
</iso-standard>
|
1152
|
+
INPUT
|
1153
|
+
presxml = <<~INPUT
|
1154
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type='presentation'>
|
1155
|
+
<preface>
|
1156
|
+
<foreword displayorder='1'>
|
1157
|
+
<ul>
|
1158
|
+
<li>A</li>
|
1159
|
+
<li>
|
1160
|
+
<ol type='alphabet'>
|
1161
|
+
<li>List</li>
|
1162
|
+
</ol>
|
1163
|
+
</li>
|
1164
|
+
</ul>
|
1165
|
+
</foreword>
|
1166
|
+
</preface>
|
1167
|
+
</iso-standard>
|
1168
|
+
INPUT
|
1169
|
+
expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({})
|
1170
|
+
.convert("test", input, true)))
|
1171
|
+
.to be_equivalent_to xmlpp(presxml)
|
1172
|
+
|
1173
|
+
end
|
677
1174
|
end
|