isodoc 1.6.1 → 1.6.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +0 -2
- data/isodoc.gemspec +1 -1
- data/lib/isodoc-yaml/i18n-ar.yaml +152 -0
- data/lib/isodoc-yaml/i18n-de.yaml +149 -0
- data/lib/isodoc-yaml/i18n-es.yaml +151 -0
- data/lib/isodoc-yaml/i18n-ru.yaml +154 -0
- data/lib/isodoc/common.rb +2 -0
- data/lib/isodoc/convert.rb +1 -1
- data/lib/isodoc/function/blocks.rb +10 -0
- data/lib/isodoc/function/form.rb +51 -0
- data/lib/isodoc/function/inline.rb +1 -0
- data/lib/isodoc/function/references.rb +55 -42
- data/lib/isodoc/function/table.rb +1 -0
- data/lib/isodoc/function/to_word_html.rb +15 -24
- data/lib/isodoc/html_convert.rb +2 -0
- data/lib/isodoc/html_function/form.rb +62 -0
- data/lib/isodoc/i18n.rb +13 -11
- data/lib/isodoc/presentation_function/inline.rb +46 -103
- data/lib/isodoc/presentation_function/math.rb +84 -0
- data/lib/isodoc/presentation_xml_convert.rb +1 -0
- data/lib/isodoc/version.rb +1 -1
- data/lib/isodoc/word_function/body.rb +28 -24
- data/spec/isodoc/form_spec.rb +156 -0
- data/spec/isodoc/inline_spec.rb +958 -928
- data/spec/isodoc/postproc_spec.rb +329 -309
- metadata +12 -4
@@ -3,6 +3,9 @@
|
|
3
3
|
require "spec_helper"
|
4
4
|
require "fileutils"
|
5
5
|
|
6
|
+
OPTIONS = { wordstylesheet: "spec/assets/word.css",
|
7
|
+
htmlstylesheet: "spec/assets/html.scss" }
|
8
|
+
|
6
9
|
RSpec.describe IsoDoc do
|
7
10
|
it "generates file based on string input" do
|
8
11
|
FileUtils.rm_f "test.doc"
|
@@ -10,7 +13,7 @@ RSpec.describe IsoDoc do
|
|
10
13
|
IsoDoc::HtmlConvert.new(
|
11
14
|
{ wordstylesheet: "spec/assets/word.css",
|
12
15
|
htmlstylesheet: "spec/assets/html.scss",
|
13
|
-
filename: "test" }
|
16
|
+
filename: "test" },
|
14
17
|
).convert("test", <<~"INPUT", false)
|
15
18
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
16
19
|
<bibdata>
|
@@ -37,7 +40,7 @@ RSpec.describe IsoDoc do
|
|
37
40
|
IsoDoc::HtmlConvert.new(
|
38
41
|
{ wordstylesheet: "word.css",
|
39
42
|
htmlstylesheet: "html.scss",
|
40
|
-
filename: "test" }
|
43
|
+
filename: "test" },
|
41
44
|
).convert("spec/assets/test", <<~"INPUT", false)
|
42
45
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
43
46
|
<bibdata>
|
@@ -111,7 +114,7 @@ RSpec.describe IsoDoc do
|
|
111
114
|
FileUtils.rm_f "test.html"
|
112
115
|
IsoDoc::WordConvert.new(
|
113
116
|
{ wordstylesheet: "spec/assets/word.css",
|
114
|
-
htmlstylesheet: "spec/assets/html.scss" }
|
117
|
+
htmlstylesheet: "spec/assets/html.scss" },
|
115
118
|
).convert("test", <<~"INPUT", false)
|
116
119
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
117
120
|
<preface><foreword>
|
@@ -133,7 +136,7 @@ RSpec.describe IsoDoc do
|
|
133
136
|
FileUtils.rm_f "spec/assets/iso.html"
|
134
137
|
IsoDoc::HtmlConvert.new(
|
135
138
|
{ wordstylesheet: "word.css",
|
136
|
-
htmlstylesheet: "html.scss" }
|
139
|
+
htmlstylesheet: "html.scss" },
|
137
140
|
).convert("spec/assets/iso.xml", nil, false)
|
138
141
|
expect(File.exist?("spec/assets/iso.html")).to be true
|
139
142
|
html = File.read("spec/assets/iso.html")
|
@@ -148,7 +151,7 @@ RSpec.describe IsoDoc do
|
|
148
151
|
FileUtils.rm_f "spec/assets/iso.html"
|
149
152
|
IsoDoc::HeadlessHtmlConvert.new(
|
150
153
|
{ wordstylesheet: "word.css",
|
151
|
-
htmlstylesheet: "html.scss" }
|
154
|
+
htmlstylesheet: "html.scss" },
|
152
155
|
).convert("spec/assets/iso.xml", nil, false)
|
153
156
|
expect(File.exist?("spec/assets/iso.headless.html")).to be true
|
154
157
|
html = File.read("spec/assets/iso.headless.html")
|
@@ -165,7 +168,7 @@ RSpec.describe IsoDoc do
|
|
165
168
|
FileUtils.rm_f "spec/assets/iso.doc"
|
166
169
|
IsoDoc::WordConvert.new(
|
167
170
|
{ wordstylesheet: "word.css",
|
168
|
-
htmlstylesheet: "html.scss" }
|
171
|
+
htmlstylesheet: "html.scss" },
|
169
172
|
).convert("spec/assets/iso.xml", nil, false)
|
170
173
|
expect(File.exist?("spec/assets/iso.doc")).to be true
|
171
174
|
word = File.read("spec/assets/iso.doc")
|
@@ -190,7 +193,7 @@ RSpec.describe IsoDoc do
|
|
190
193
|
scripts: "spec/assets/scripts.html",
|
191
194
|
i18nyaml: "spec/assets/i18n.yaml",
|
192
195
|
ulstyle: "l1",
|
193
|
-
olstyle: "l2" }
|
196
|
+
olstyle: "l2" },
|
194
197
|
).convert("test", <<~"INPUT", false)
|
195
198
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
196
199
|
<preface><foreword>
|
@@ -227,7 +230,7 @@ RSpec.describe IsoDoc do
|
|
227
230
|
scripts: "spec/assets/scripts.html",
|
228
231
|
i18nyaml: "spec/assets/i18n.yaml",
|
229
232
|
ulstyle: "l1",
|
230
|
-
olstyle: "l2" }
|
233
|
+
olstyle: "l2" },
|
231
234
|
).convert("test", <<~"INPUT", false)
|
232
235
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
233
236
|
<preface><foreword>
|
@@ -272,7 +275,7 @@ RSpec.describe IsoDoc do
|
|
272
275
|
wordintropage: "spec/assets/wordintro.html",
|
273
276
|
i18nyaml: "spec/assets/i18n.yaml",
|
274
277
|
ulstyle: "l1",
|
275
|
-
olstyle: "l2" }
|
278
|
+
olstyle: "l2" },
|
276
279
|
).convert("test", <<~"INPUT", false)
|
277
280
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
278
281
|
<preface><foreword>
|
@@ -311,7 +314,7 @@ RSpec.describe IsoDoc do
|
|
311
314
|
wordintropage: "spec/assets/wordintro.html",
|
312
315
|
i18nyaml: "spec/assets/i18n.yaml",
|
313
316
|
ulstyle: "l1",
|
314
|
-
olstyle: "l2" }
|
317
|
+
olstyle: "l2" },
|
315
318
|
).convert("test", <<~"INPUT", false)
|
316
319
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
317
320
|
<preface><foreword>
|
@@ -344,7 +347,7 @@ RSpec.describe IsoDoc do
|
|
344
347
|
FileUtils.rm_f "test.html"
|
345
348
|
IsoDoc::WordConvert.new(
|
346
349
|
{ wordstylesheet: "spec/assets/word.css",
|
347
|
-
htmlstylesheet: "spec/assets/html.scss" }
|
350
|
+
htmlstylesheet: "spec/assets/html.scss" },
|
348
351
|
).convert("test", <<~"INPUT", false)
|
349
352
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
350
353
|
<preface><foreword>
|
@@ -390,7 +393,7 @@ RSpec.describe IsoDoc do
|
|
390
393
|
FileUtils.rm_f "test.html"
|
391
394
|
IsoDoc::WordConvert.new(
|
392
395
|
{ wordstylesheet: "spec/assets/word.css",
|
393
|
-
htmlstylesheet: "spec/assets/html.scss" }
|
396
|
+
htmlstylesheet: "spec/assets/html.scss" },
|
394
397
|
).convert("test", <<~"INPUT", false)
|
395
398
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
396
399
|
<sections>
|
@@ -426,7 +429,7 @@ RSpec.describe IsoDoc do
|
|
426
429
|
IsoDoc::WordConvert.new(
|
427
430
|
{ wordstylesheet: "spec/assets/word.css",
|
428
431
|
htmlstylesheet: "spec/assets/html.scss",
|
429
|
-
header: "spec/assets/header.html" }
|
432
|
+
header: "spec/assets/header.html" },
|
430
433
|
).convert("test", <<~"INPUT", false)
|
431
434
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
432
435
|
<bibdata type="article">
|
@@ -454,7 +457,7 @@ RSpec.describe IsoDoc do
|
|
454
457
|
IsoDoc::WordConvert.new(
|
455
458
|
{ wordstylesheet: "spec/assets/word.css",
|
456
459
|
htmlstylesheet: "spec/assets/html.scss",
|
457
|
-
wordintropage: "spec/assets/wordintro.html" }
|
460
|
+
wordintropage: "spec/assets/wordintro.html" },
|
458
461
|
).convert("test", <<~"INPUT", false)
|
459
462
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
460
463
|
<sections>
|
@@ -478,55 +481,56 @@ RSpec.describe IsoDoc do
|
|
478
481
|
word = File.read("test.doc")
|
479
482
|
.sub(/^.*<div class="WordSection2">/m, '<div class="WordSection2">')
|
480
483
|
.sub(%r{<p class="MsoNormal">\s*<br clear="all" class="section"/>\s*</p>\s*<div class="WordSection3">.*$}m, "")
|
481
|
-
expect(xmlpp(word.gsub(/_Toc\d\d+/, "_Toc")))
|
484
|
+
expect(xmlpp(word.gsub(/_Toc\d\d+/, "_Toc")))
|
485
|
+
.to be_equivalent_to xmlpp(<<~'OUTPUT')
|
482
486
|
<div class="WordSection2">
|
483
|
-
|
487
|
+
/* an empty word intro page */
|
484
488
|
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
489
|
+
<p class="MsoToc1"><span lang="EN-GB" xml:lang="EN-GB"><span style="mso-element:field-begin"></span><span style="mso-spacerun:yes"> </span>TOC
|
490
|
+
\o "1-2" \h \z \u <span style="mso-element:field-separator"></span></span>
|
491
|
+
<span class="MsoHyperlink"><span lang="EN-GB" style="mso-no-proof:yes" xml:lang="EN-GB">
|
492
|
+
<a href="#_Toc">Clause 4<span lang="EN-GB" class="MsoTocTextSpan" xml:lang="EN-GB">
|
493
|
+
<span style="mso-tab-count:1 dotted">. </span>
|
494
|
+
</span><span lang="EN-GB" class="MsoTocTextSpan" xml:lang="EN-GB">
|
495
|
+
<span style="mso-element:field-begin"></span></span>
|
496
|
+
<span lang="EN-GB" class="MsoTocTextSpan" xml:lang="EN-GB"> PAGEREF _Toc \h </span>
|
497
|
+
<span lang="EN-GB" class="MsoTocTextSpan" xml:lang="EN-GB"><span style="mso-element:field-separator"></span></span><span lang="EN-GB" class="MsoTocTextSpan" xml:lang="EN-GB">1</span>
|
498
|
+
<span lang="EN-GB" class="MsoTocTextSpan" xml:lang="EN-GB"></span><span lang="EN-GB" class="MsoTocTextSpan" xml:lang="EN-GB"><span style="mso-element:field-end"></span></span></a></span></span></p>
|
499
|
+
<p class="MsoToc2">
|
500
|
+
<span class="MsoHyperlink">
|
501
|
+
<span lang="EN-GB" style="mso-no-proof:yes" xml:lang="EN-GB">
|
502
|
+
<a href="#_Toc">Introduction to this<span lang="EN-GB" class="MsoTocTextSpan" xml:lang="EN-GB">
|
503
|
+
<span style="mso-tab-count:1 dotted">. </span>
|
504
|
+
</span><span lang="EN-GB" class="MsoTocTextSpan" xml:lang="EN-GB">
|
505
|
+
<span style="mso-element:field-begin"></span></span>
|
506
|
+
<span lang="EN-GB" class="MsoTocTextSpan" xml:lang="EN-GB"> PAGEREF _Toc \h </span>
|
507
|
+
<span lang="EN-GB" class="MsoTocTextSpan" xml:lang="EN-GB"><span style="mso-element:field-separator"></span></span><span lang="EN-GB" class="MsoTocTextSpan" xml:lang="EN-GB">1</span>
|
508
|
+
<span lang="EN-GB" class="MsoTocTextSpan" xml:lang="EN-GB"></span><span lang="EN-GB" class="MsoTocTextSpan" xml:lang="EN-GB"><span style="mso-element:field-end"></span></span></a></span>
|
509
|
+
</span>
|
510
|
+
</p>
|
511
|
+
<p class="MsoToc2">
|
512
|
+
<span class="MsoHyperlink">
|
513
|
+
<span lang="EN-GB" style="mso-no-proof:yes" xml:lang="EN-GB">
|
514
|
+
<a href="#_Toc">Clause 4.2<span lang="EN-GB" class="MsoTocTextSpan" xml:lang="EN-GB">
|
515
|
+
<span style="mso-tab-count:1 dotted">. </span>
|
516
|
+
</span><span lang="EN-GB" class="MsoTocTextSpan" xml:lang="EN-GB">
|
517
|
+
<span style="mso-element:field-begin"></span></span>
|
518
|
+
<span lang="EN-GB" class="MsoTocTextSpan" xml:lang="EN-GB"> PAGEREF _Toc \h </span>
|
519
|
+
<span lang="EN-GB" class="MsoTocTextSpan" xml:lang="EN-GB"><span style="mso-element:field-separator"></span></span><span lang="EN-GB" class="MsoTocTextSpan" xml:lang="EN-GB">1</span>
|
520
|
+
<span lang="EN-GB" class="MsoTocTextSpan" xml:lang="EN-GB"></span><span lang="EN-GB" class="MsoTocTextSpan" xml:lang="EN-GB"><span style="mso-element:field-end"></span></span></a></span>
|
521
|
+
</span>
|
522
|
+
</p>
|
523
|
+
<p class="MsoToc1">
|
524
|
+
<span lang="EN-GB" xml:lang="EN-GB">
|
525
|
+
<span style="mso-element:field-end"></span>
|
526
|
+
</span>
|
527
|
+
<span lang="EN-GB" xml:lang="EN-GB">
|
528
|
+
<p class="MsoNormal"> </p>
|
529
|
+
</span>
|
530
|
+
</p>
|
531
|
+
<p class="MsoNormal"> </p>
|
532
|
+
</div>
|
533
|
+
OUTPUT
|
530
534
|
end
|
531
535
|
|
532
536
|
it "populates Word ToC with custom levels" do
|
@@ -535,7 +539,7 @@ RSpec.describe IsoDoc do
|
|
535
539
|
{ wordstylesheet: "spec/assets/word.css",
|
536
540
|
htmlstylesheet: "spec/assets/html.scss",
|
537
541
|
wordintropage: "spec/assets/wordintro.html",
|
538
|
-
doctoclevels: 3 }
|
542
|
+
doctoclevels: 3 },
|
539
543
|
).convert("test", <<~"INPUT", false)
|
540
544
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
541
545
|
<sections>
|
@@ -648,7 +652,7 @@ RSpec.describe IsoDoc do
|
|
648
652
|
IsoDoc::HtmlConvert.new(
|
649
653
|
{ wordstylesheet: "spec/assets/word.css",
|
650
654
|
htmlstylesheet: "spec/assets/html.scss",
|
651
|
-
wordintropage: "spec/assets/wordintro.html" }
|
655
|
+
wordintropage: "spec/assets/wordintro.html" },
|
652
656
|
).convert("test", <<~"INPUT", false)
|
653
657
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
654
658
|
<sections>
|
@@ -669,7 +673,8 @@ RSpec.describe IsoDoc do
|
|
669
673
|
</iso-standard>
|
670
674
|
INPUT
|
671
675
|
html = File.read("test.html")
|
672
|
-
.sub(/^.*<main class="main-section">/m,
|
676
|
+
.sub(/^.*<main class="main-section">/m,
|
677
|
+
'<main xmlns:epub="epub" class="main-section">')
|
673
678
|
.sub(%r{</main>.*$}m, "</main>")
|
674
679
|
expect(xmlpp(html)).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
675
680
|
<main xmlns:epub="epub" class="main-section"><button onclick="topFunction()" id="myBtn" title="Go to top">Top</button>
|
@@ -704,7 +709,7 @@ RSpec.describe IsoDoc do
|
|
704
709
|
FileUtils.rm_rf "test_htmlimages"
|
705
710
|
IsoDoc::HtmlConvert.new(
|
706
711
|
{ wordstylesheet: "spec/assets/word.css",
|
707
|
-
htmlstylesheet: "spec/assets/html.scss" }
|
712
|
+
htmlstylesheet: "spec/assets/html.scss" },
|
708
713
|
).convert("test", <<~"INPUT", false)
|
709
714
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
710
715
|
<preface><foreword>
|
@@ -913,7 +918,7 @@ RSpec.describe IsoDoc do
|
|
913
918
|
FileUtils.rm_rf "test_htmlimages"
|
914
919
|
IsoDoc::HtmlConvert.new(
|
915
920
|
{ wordstylesheet: "spec/assets/word.css",
|
916
|
-
htmlstylesheet: "spec/assets/html.scss" }
|
921
|
+
htmlstylesheet: "spec/assets/html.scss" },
|
917
922
|
).convert("test", <<~"INPUT", false)
|
918
923
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
919
924
|
<preface><foreword>
|
@@ -952,154 +957,161 @@ RSpec.describe IsoDoc do
|
|
952
957
|
it "moves images in HTML, using relative file location" do
|
953
958
|
FileUtils.rm_f "spec/test.html"
|
954
959
|
FileUtils.rm_rf "spec/test_htmlimages"
|
955
|
-
IsoDoc::HtmlConvert.new({ wordstylesheet: "assets/word.css", htmlstylesheet: "assets/html.scss" })
|
956
|
-
|
957
|
-
|
958
|
-
|
959
|
-
|
960
|
-
|
961
|
-
|
962
|
-
|
963
|
-
|
964
|
-
|
965
|
-
|
966
|
-
|
967
|
-
|
960
|
+
IsoDoc::HtmlConvert.new({ wordstylesheet: "assets/word.css", htmlstylesheet: "assets/html.scss" })
|
961
|
+
.convert("spec/test", <<~"INPUT", false)
|
962
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
963
|
+
<preface><foreword>
|
964
|
+
<figure id="_">
|
965
|
+
<name>Split-it-right sample divider</name>
|
966
|
+
<image src="#{File.expand_path(File.join(File.dirname(__FILE__), '..', 'assets/rice_image1.png'))}" id="_" mimetype="image/png"/>
|
967
|
+
<image src="assets/rice_image1.png" id="_" mimetype="image/png"/>
|
968
|
+
<image src="assets/rice_image1.png" id="_" width="20000" height="300000" mimetype="image/png"/>
|
969
|
+
<image src="assets/rice_image1.png" id="_" width="99" height="auto" mimetype="image/png"/>
|
970
|
+
</figure>
|
971
|
+
</foreword></preface>
|
972
|
+
</iso-standard>
|
973
|
+
INPUT
|
968
974
|
html = File.read("spec/test.html")
|
969
975
|
.sub(/^.*<main class="main-section">/m, '<main class="main-section">')
|
970
976
|
.sub(%r{</main>.*$}m, "</main>")
|
971
977
|
expect(`ls test_htmlimages`).to match(/\.png$/)
|
972
|
-
expect(xmlpp(html.gsub(/\/[0-9a-f-]+\.png/, "/_.png")))
|
973
|
-
|
974
|
-
<
|
975
|
-
|
976
|
-
<
|
977
|
-
|
978
|
-
|
979
|
-
|
980
|
-
|
981
|
-
|
982
|
-
|
983
|
-
|
984
|
-
|
985
|
-
|
986
|
-
|
978
|
+
expect(xmlpp(html.gsub(/\/[0-9a-f-]+\.png/, "/_.png")))
|
979
|
+
.to be_equivalent_to xmlpp(<<~"OUTPUT")
|
980
|
+
<main class="main-section"><button onclick="topFunction()" id="myBtn" title="Go to top">Top</button>
|
981
|
+
<br />
|
982
|
+
<div>
|
983
|
+
<h1 class="ForewordTitle">Foreword</h1>
|
984
|
+
<div id="_" class="figure">
|
985
|
+
<img src="test_htmlimages/_.png" height="776" width="922" />
|
986
|
+
<img src="test_htmlimages/_.png" height="776" width="922" />
|
987
|
+
<img src="test_htmlimages/_.png" height="800" width="53" />
|
988
|
+
<img src="test_htmlimages/_.png" height="83" width="99" />
|
989
|
+
<p class="FigureTitle" style="text-align:center;">Split-it-right sample divider</p></div>
|
990
|
+
</div>
|
991
|
+
<p class="zzSTDTitle1"></p>
|
992
|
+
</main>
|
993
|
+
OUTPUT
|
987
994
|
end
|
988
995
|
|
989
996
|
it "encodes images in HTML as data URIs" do
|
990
997
|
FileUtils.rm_f "test.html"
|
991
998
|
FileUtils.rm_rf "test_htmlimages"
|
992
|
-
IsoDoc::HtmlConvert.new({ htmlstylesheet: "spec/assets/html.scss", datauriimage: true })
|
993
|
-
|
994
|
-
|
995
|
-
|
996
|
-
|
997
|
-
|
998
|
-
|
999
|
-
|
1000
|
-
|
1001
|
-
|
1002
|
-
|
999
|
+
IsoDoc::HtmlConvert.new({ htmlstylesheet: "spec/assets/html.scss", datauriimage: true })
|
1000
|
+
.convert("test", <<~"INPUT", false)
|
1001
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
1002
|
+
<preface><foreword>
|
1003
|
+
<figure id="_">
|
1004
|
+
<name>Split-it-right sample divider</name>
|
1005
|
+
<image src="#{File.expand_path(File.join(File.dirname(__FILE__), '..', 'assets/rice_image1.png'))}" id="_" mimetype="image/png"/>
|
1006
|
+
<image src="spec/assets/rice_image1.png" id="_" mimetype="image/png"/>
|
1007
|
+
</figure>
|
1008
|
+
</foreword></preface>
|
1009
|
+
</iso-standard>
|
1010
|
+
INPUT
|
1003
1011
|
html = File.read("test.html")
|
1004
1012
|
.sub(/^.*<main class="main-section">/m, '<main class="main-section">')
|
1005
1013
|
.sub(%r{</main>.*$}m, "</main>")
|
1006
|
-
expect(xmlpp(html.gsub(%r{src="data:image/png;base64,[^"]+"}, %{src="data:image/png;base64,_"})))
|
1007
|
-
|
1008
|
-
<
|
1009
|
-
|
1010
|
-
<
|
1011
|
-
|
1012
|
-
|
1013
|
-
|
1014
|
-
|
1015
|
-
|
1016
|
-
|
1017
|
-
|
1018
|
-
|
1014
|
+
expect(xmlpp(html.gsub(%r{src="data:image/png;base64,[^"]+"}, %{src="data:image/png;base64,_"})))
|
1015
|
+
.to be_equivalent_to xmlpp(<<~"OUTPUT")
|
1016
|
+
<main class="main-section"><button onclick="topFunction()" id="myBtn" title="Go to top">Top</button>
|
1017
|
+
<br />
|
1018
|
+
<div>
|
1019
|
+
<h1 class="ForewordTitle">Foreword</h1>
|
1020
|
+
<div id="_" class="figure">
|
1021
|
+
<img src="data:image/png;base64,_" height="776" width="922" />
|
1022
|
+
<img src="data:image/png;base64,_" height="776" width="922" />
|
1023
|
+
<p class="FigureTitle" style="text-align:center;">Split-it-right sample divider</p></div>
|
1024
|
+
</div>
|
1025
|
+
<p class="zzSTDTitle1"></p>
|
1026
|
+
</main>
|
1027
|
+
OUTPUT
|
1019
1028
|
end
|
1020
1029
|
|
1021
1030
|
it "encodes images in HTML as data URIs, using relative file location" do
|
1022
1031
|
FileUtils.rm_f "spec/test.html"
|
1023
1032
|
FileUtils.rm_rf "spec/test_htmlimages"
|
1024
|
-
IsoDoc::HtmlConvert.new({ htmlstylesheet: "assets/html.scss", datauriimage: true })
|
1025
|
-
|
1026
|
-
|
1027
|
-
|
1028
|
-
|
1029
|
-
|
1030
|
-
|
1031
|
-
|
1032
|
-
|
1033
|
-
|
1034
|
-
|
1033
|
+
IsoDoc::HtmlConvert.new({ htmlstylesheet: "assets/html.scss", datauriimage: true })
|
1034
|
+
.convert("spec/test", <<~"INPUT", false)
|
1035
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
1036
|
+
<preface><foreword>
|
1037
|
+
<figure id="_">
|
1038
|
+
<name>Split-it-right sample divider</name>
|
1039
|
+
<image src="#{File.expand_path(File.join(File.dirname(__FILE__), '..', 'assets/rice_image1.png'))}" id="_" mimetype="image/png"/>
|
1040
|
+
<image src="assets/rice_image1.png" id="_" mimetype="image/png"/>
|
1041
|
+
</figure>
|
1042
|
+
</foreword></preface>
|
1043
|
+
</iso-standard>
|
1044
|
+
INPUT
|
1035
1045
|
html = File.read("spec/test.html")
|
1036
1046
|
.sub(/^.*<main class="main-section">/m, '<main class="main-section">')
|
1037
1047
|
.sub(%r{</main>.*$}m, "</main>")
|
1038
|
-
expect(xmlpp(html.gsub(%r{src="data:image/png;base64,[^"]+"}, %{src="data:image/png;base64,_"})))
|
1039
|
-
|
1040
|
-
<
|
1041
|
-
|
1042
|
-
<
|
1043
|
-
|
1044
|
-
|
1045
|
-
|
1046
|
-
|
1047
|
-
|
1048
|
-
|
1049
|
-
|
1050
|
-
|
1048
|
+
expect(xmlpp(html.gsub(%r{src="data:image/png;base64,[^"]+"}, %{src="data:image/png;base64,_"})))
|
1049
|
+
.to be_equivalent_to xmlpp(<<~"OUTPUT")
|
1050
|
+
<main class="main-section"><button onclick="topFunction()" id="myBtn" title="Go to top">Top</button>
|
1051
|
+
<br />
|
1052
|
+
<div>
|
1053
|
+
<h1 class="ForewordTitle">Foreword</h1>
|
1054
|
+
<div id="_" class="figure">
|
1055
|
+
<img src="data:image/png;base64,_" height="776" width="922" />
|
1056
|
+
<img src="data:image/png;base64,_" height="776" width="922" />
|
1057
|
+
<p class="FigureTitle" style="text-align:center;">Split-it-right sample divider</p></div>
|
1058
|
+
</div>
|
1059
|
+
<p class="zzSTDTitle1"></p>
|
1060
|
+
</main>
|
1061
|
+
OUTPUT
|
1051
1062
|
end
|
1052
1063
|
|
1053
1064
|
it "processes IsoXML terms for HTML" do
|
1054
1065
|
FileUtils.rm_f "test.html"
|
1055
1066
|
FileUtils.rm_f "test.doc"
|
1056
|
-
IsoDoc::HtmlConvert.new(
|
1057
|
-
|
1058
|
-
|
1059
|
-
|
1060
|
-
|
1061
|
-
|
1062
|
-
|
1063
|
-
|
1064
|
-
<
|
1065
|
-
|
1066
|
-
|
1067
|
-
|
1068
|
-
|
1069
|
-
|
1070
|
-
<
|
1071
|
-
|
1072
|
-
|
1073
|
-
|
1074
|
-
|
1075
|
-
<
|
1076
|
-
<
|
1077
|
-
|
1078
|
-
|
1079
|
-
|
1080
|
-
|
1081
|
-
|
1082
|
-
|
1083
|
-
|
1084
|
-
|
1085
|
-
<
|
1086
|
-
|
1087
|
-
|
1088
|
-
|
1089
|
-
|
1090
|
-
<
|
1091
|
-
|
1092
|
-
|
1093
|
-
|
1094
|
-
<
|
1095
|
-
|
1096
|
-
|
1097
|
-
<
|
1098
|
-
|
1099
|
-
|
1100
|
-
|
1101
|
-
|
1102
|
-
|
1067
|
+
IsoDoc::HtmlConvert.new(OPTIONS)
|
1068
|
+
.convert("test", <<~"INPUT", false)
|
1069
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
1070
|
+
<sections>
|
1071
|
+
<terms id="_terms_and_definitions" obligation="normative"><title>Terms and Definitions</title>
|
1072
|
+
<term id="paddy1"><name>1.1.</name><preferred>paddy</preferred>
|
1073
|
+
<domain>rice</domain>
|
1074
|
+
<definition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p></definition>
|
1075
|
+
<termexample id="_bd57bbf1-f948-4bae-b0ce-73c00431f892">
|
1076
|
+
<p id="_65c9a509-9a89-4b54-a890-274126aeb55c">Foreign seeds, husks, bran, sand, dust.</p>
|
1077
|
+
<ul>
|
1078
|
+
<li>A</li>
|
1079
|
+
</ul>
|
1080
|
+
</termexample>
|
1081
|
+
<termexample id="_bd57bbf1-f948-4bae-b0ce-73c00431f894">
|
1082
|
+
<ul>
|
1083
|
+
<li>A</li>
|
1084
|
+
</ul>
|
1085
|
+
</termexample>
|
1086
|
+
<termsource status="modified">
|
1087
|
+
<origin bibitemid="ISO7301" type="inline" citeas="ISO 7301:2011"><locality type="clause"><referenceFrom>3.1</referenceFrom></locality></origin>
|
1088
|
+
<modification>
|
1089
|
+
<p id="_e73a417d-ad39-417d-a4c8-20e4e2529489">The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here</p>
|
1090
|
+
</modification>
|
1091
|
+
</termsource></term>
|
1092
|
+
<term id="paddy"><name>1.2.</name><preferred>paddy</preferred><admitted>paddy rice</admitted>
|
1093
|
+
<admitted>rough rice</admitted>
|
1094
|
+
<deprecates>cargo rice</deprecates>
|
1095
|
+
<definition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p></definition>
|
1096
|
+
<termexample id="_bd57bbf1-f948-4bae-b0ce-73c00431f893">
|
1097
|
+
<ul>
|
1098
|
+
<li>A</li>
|
1099
|
+
</ul>
|
1100
|
+
</termexample>
|
1101
|
+
<termnote id="_671a1994-4783-40d0-bc81-987d06ffb74e">
|
1102
|
+
<p id="_19830f33-e46c-42cc-94ca-a5ef101132d5">The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.</p>
|
1103
|
+
</termnote>
|
1104
|
+
<termnote id="_671a1994-4783-40d0-bc81-987d06ffb74f">
|
1105
|
+
<ul><li>A</li></ul>
|
1106
|
+
<p id="_19830f33-e46c-42cc-94ca-a5ef101132d5">The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.</p>
|
1107
|
+
</termnote>
|
1108
|
+
<termsource status="identical">
|
1109
|
+
<origin bibitemid="ISO7301" type="inline" citeas="ISO 7301:2011"><locality type="clause"><referenceFrom>3.1</referenceFrom></locality></origin>
|
1110
|
+
</termsource></term>
|
1111
|
+
</terms>
|
1112
|
+
</sections>
|
1113
|
+
</iso-standard>
|
1114
|
+
INPUT
|
1103
1115
|
expect(File.exist?("test.html")).to be true
|
1104
1116
|
html = File.read("test.html")
|
1105
1117
|
expect(html).to match(%r{<h2 class="TermNum" id="paddy1">1\.1\.</h2>})
|
@@ -1109,34 +1121,35 @@ RSpec.describe IsoDoc do
|
|
1109
1121
|
it "processes empty term modifications" do
|
1110
1122
|
FileUtils.rm_f "test.html"
|
1111
1123
|
FileUtils.rm_f "test.doc"
|
1112
|
-
IsoDoc::HtmlConvert.new(
|
1113
|
-
|
1114
|
-
|
1115
|
-
|
1116
|
-
|
1117
|
-
|
1118
|
-
|
1119
|
-
|
1120
|
-
<
|
1121
|
-
|
1122
|
-
|
1123
|
-
|
1124
|
-
|
1125
|
-
|
1126
|
-
<
|
1127
|
-
|
1128
|
-
|
1129
|
-
|
1130
|
-
|
1131
|
-
<
|
1132
|
-
<
|
1133
|
-
|
1134
|
-
|
1135
|
-
|
1136
|
-
|
1137
|
-
|
1138
|
-
|
1139
|
-
|
1124
|
+
IsoDoc::HtmlConvert.new(OPTIONS)
|
1125
|
+
.convert("test", <<~"INPUT", false)
|
1126
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
1127
|
+
<sections>
|
1128
|
+
<terms id="_terms_and_definitions" obligation="normative"><title>Terms and Definitions</title>
|
1129
|
+
<term id="paddy1"><preferred>paddy</preferred>
|
1130
|
+
<domain>rice</domain>
|
1131
|
+
<definition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p></definition>
|
1132
|
+
<termexample id="_bd57bbf1-f948-4bae-b0ce-73c00431f892">
|
1133
|
+
<p id="_65c9a509-9a89-4b54-a890-274126aeb55c">Foreign seeds, husks, bran, sand, dust.</p>
|
1134
|
+
<ul>
|
1135
|
+
<li>A</li>
|
1136
|
+
</ul>
|
1137
|
+
</termexample>
|
1138
|
+
<termexample id="_bd57bbf1-f948-4bae-b0ce-73c00431f894">
|
1139
|
+
<ul>
|
1140
|
+
<li>A</li>
|
1141
|
+
</ul>
|
1142
|
+
</termexample>
|
1143
|
+
<termsource status="modified">
|
1144
|
+
<origin bibitemid="ISO7301" type="inline" citeas="ISO 7301:2011">ISO 7301:2011, Clause 3.1</origin>
|
1145
|
+
<modification>
|
1146
|
+
<p id="_e73a417d-ad39-417d-a4c8-20e4e2529489"/>
|
1147
|
+
</modification>
|
1148
|
+
</termsource></term>
|
1149
|
+
</terms>
|
1150
|
+
</sections>
|
1151
|
+
</iso-standard>
|
1152
|
+
INPUT
|
1140
1153
|
expect(File.exist?("test.html")).to be true
|
1141
1154
|
html = File.read("test.html")
|
1142
1155
|
expect(html).to include '[SOURCE: <a href="#ISO7301">ISO 7301:2011, Clause 3.1</a>, modified]'
|
@@ -1145,37 +1158,38 @@ RSpec.describe IsoDoc do
|
|
1145
1158
|
it "creates continuation styles for multiparagraph list items in Word" do
|
1146
1159
|
FileUtils.rm_f "test.doc"
|
1147
1160
|
FileUtils.rm_f "test.html"
|
1148
|
-
IsoDoc::WordConvert.new(
|
1149
|
-
|
1150
|
-
|
1151
|
-
|
1152
|
-
|
1153
|
-
|
1154
|
-
|
1155
|
-
|
1156
|
-
|
1157
|
-
|
1158
|
-
|
1159
|
-
|
1160
|
-
|
1161
|
-
|
1162
|
-
|
1163
|
-
|
1164
|
-
|
1165
|
-
|
1166
|
-
|
1167
|
-
|
1168
|
-
|
1169
|
-
|
1170
|
-
|
1171
|
-
|
1172
|
-
|
1173
|
-
|
1174
|
-
|
1175
|
-
|
1176
|
-
|
1177
|
-
|
1178
|
-
|
1161
|
+
IsoDoc::WordConvert.new(OPTIONS)
|
1162
|
+
.convert("test", <<~"INPUT", false)
|
1163
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
1164
|
+
<preface><foreword>
|
1165
|
+
<ul>
|
1166
|
+
<li><p>A</p>
|
1167
|
+
<p>B</p></li>
|
1168
|
+
<li><ol><li><p>C</p>
|
1169
|
+
<p>D</p>
|
1170
|
+
<sourcecode>E</sourcecode></li>
|
1171
|
+
</ol></li>
|
1172
|
+
</ul>
|
1173
|
+
<ol>
|
1174
|
+
<li><p>A1</p>
|
1175
|
+
<p>B1</p></li>
|
1176
|
+
<li><ul><li><p>C1</p>
|
1177
|
+
<formula id="_5fc1ef0f-75d2-4b54-802c-b1bad4a53b62">
|
1178
|
+
<stem type="AsciiMath">D1</stem>
|
1179
|
+
</formula>
|
1180
|
+
<dl id="_f8fb7ed7-7874-44a8-933f-06e0e86fb264">
|
1181
|
+
<dt>
|
1182
|
+
<em>n</em>
|
1183
|
+
</dt>
|
1184
|
+
<dd>
|
1185
|
+
<p id="_a27281a4-b20e-4d0b-a780-bab9e851b03e">is the number of coating layers</p>
|
1186
|
+
</dd>
|
1187
|
+
</dl>
|
1188
|
+
</ul></li>
|
1189
|
+
</ol>
|
1190
|
+
</foreword></preface>
|
1191
|
+
</iso-standard>
|
1192
|
+
INPUT
|
1179
1193
|
word = File.read("test.doc")
|
1180
1194
|
.sub(/^.*<div class="WordSection2">/m, '<div class="WordSection2" xmlns:m="m">')
|
1181
1195
|
.sub(%r{<p class="MsoNormal">\s*<br clear="all" class="section"/>\s*</p>\s*<div class="WordSection3">.*$}m, "")
|
@@ -1255,16 +1269,17 @@ RSpec.describe IsoDoc do
|
|
1255
1269
|
it "does not lose HTML escapes in postprocessing" do
|
1256
1270
|
FileUtils.rm_f "test.doc"
|
1257
1271
|
FileUtils.rm_f "test.html"
|
1258
|
-
IsoDoc::HtmlConvert.new(
|
1259
|
-
|
1260
|
-
|
1261
|
-
|
1262
|
-
|
1263
|
-
|
1264
|
-
|
1265
|
-
|
1266
|
-
|
1267
|
-
|
1272
|
+
IsoDoc::HtmlConvert.new(OPTIONS)
|
1273
|
+
.convert("test", <<~"INPUT", false)
|
1274
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
1275
|
+
<preface><foreword>
|
1276
|
+
<sourcecode id="samplecode">
|
1277
|
+
<name>XML code</name>
|
1278
|
+
<xml> &
|
1279
|
+
</sourcecode>
|
1280
|
+
</foreword></preface>
|
1281
|
+
</iso-standard>
|
1282
|
+
INPUT
|
1268
1283
|
html = File.read("test.html")
|
1269
1284
|
.sub(/^.*<main class="main-section">/m, '<main class="main-section">')
|
1270
1285
|
.sub(%r{</main>.*$}m, "</main>")
|
@@ -1285,16 +1300,17 @@ RSpec.describe IsoDoc do
|
|
1285
1300
|
it "does not lose HTML escapes in postprocessing (Word)" do
|
1286
1301
|
FileUtils.rm_f "test.doc"
|
1287
1302
|
FileUtils.rm_f "test.html"
|
1288
|
-
IsoDoc::WordConvert.new(
|
1289
|
-
|
1290
|
-
|
1291
|
-
|
1292
|
-
|
1293
|
-
|
1294
|
-
|
1295
|
-
|
1296
|
-
|
1297
|
-
|
1303
|
+
IsoDoc::WordConvert.new(OPTIONS)
|
1304
|
+
.convert("test", <<~"INPUT", false)
|
1305
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
1306
|
+
<preface><foreword>
|
1307
|
+
<sourcecode id="samplecode">
|
1308
|
+
<name>XML code</name>
|
1309
|
+
<xml> &
|
1310
|
+
</sourcecode>
|
1311
|
+
</foreword></preface>
|
1312
|
+
</iso-standard>
|
1313
|
+
INPUT
|
1298
1314
|
word = File.read("test.doc")
|
1299
1315
|
.sub(/^.*<div class="WordSection2">/m, '<div class="WordSection2">')
|
1300
1316
|
.sub(%r{<p class="MsoNormal">\s*<br clear="all" class="section"/>\s*</p>\s*<div class="WordSection3">.*$}m, "")
|
@@ -1315,7 +1331,7 @@ RSpec.describe IsoDoc do
|
|
1315
1331
|
it "propagates example style to paragraphs in postprocessing (Word)" do
|
1316
1332
|
FileUtils.rm_f "test.doc"
|
1317
1333
|
FileUtils.rm_f "test.html"
|
1318
|
-
IsoDoc::WordConvert.new(
|
1334
|
+
IsoDoc::WordConvert.new(OPTIONS).convert("test", <<~"INPUT", false)
|
1319
1335
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
1320
1336
|
<preface><foreword>
|
1321
1337
|
<example id="samplecode">
|
@@ -1346,16 +1362,17 @@ RSpec.describe IsoDoc do
|
|
1346
1362
|
it "deals with image captions (Word)" do
|
1347
1363
|
FileUtils.rm_f "test.doc"
|
1348
1364
|
FileUtils.rm_f "test.html"
|
1349
|
-
IsoDoc::WordConvert.new(
|
1350
|
-
|
1351
|
-
|
1352
|
-
|
1353
|
-
<
|
1354
|
-
|
1355
|
-
|
1356
|
-
|
1357
|
-
|
1358
|
-
|
1365
|
+
IsoDoc::WordConvert.new(OPTIONS)
|
1366
|
+
.convert("test", <<~"INPUT", false)
|
1367
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
1368
|
+
<preface><foreword>
|
1369
|
+
<figure id="fig1">
|
1370
|
+
<name>Typical arrangement of the far-field scan set-up</name>
|
1371
|
+
<image src="spec/assets/rice_image1.png" id="_" mimetype="image/png"/>
|
1372
|
+
</figure>
|
1373
|
+
</foreword></preface>
|
1374
|
+
</iso-standard>
|
1375
|
+
INPUT
|
1359
1376
|
word = File.read("test.doc")
|
1360
1377
|
.sub(/^.*<div class="WordSection2">/m, '<div class="WordSection2">')
|
1361
1378
|
.sub(%r{<p class="MsoNormal">\s*<br clear="all" class="section"/>\s*</p>\s*<div class="WordSection3">.*$}m, "")
|
@@ -1379,20 +1396,21 @@ RSpec.describe IsoDoc do
|
|
1379
1396
|
it "deals with empty table titles (Word)" do
|
1380
1397
|
FileUtils.rm_f "test.doc"
|
1381
1398
|
FileUtils.rm_f "test.html"
|
1382
|
-
IsoDoc::WordConvert.new(
|
1383
|
-
|
1384
|
-
|
1385
|
-
|
1386
|
-
|
1387
|
-
<
|
1388
|
-
|
1389
|
-
|
1390
|
-
|
1391
|
-
|
1392
|
-
|
1393
|
-
|
1394
|
-
|
1395
|
-
|
1399
|
+
IsoDoc::WordConvert.new(OPTIONS)
|
1400
|
+
.convert("test", <<~"INPUT", false)
|
1401
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
1402
|
+
<preface><foreword>
|
1403
|
+
<table id="_fe12b8f8-6858-4cd6-af7d-d4b6f3ebd1a7" unnumbered="true"><thead><tr>
|
1404
|
+
<td rowspan="2">
|
1405
|
+
<p id="_c47d9b39-adb2-431d-9320-78cb148fdb56">Output wavelength <stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><mrow><mo>(</mo><mi>μ</mi><mi>m</mi><mo>)</mo></mrow></math></stem></p>
|
1406
|
+
</td>
|
1407
|
+
<th colspan="3" align="left">Predictive wavelengths</th>
|
1408
|
+
</tr>
|
1409
|
+
</thead>
|
1410
|
+
</table>
|
1411
|
+
</preface>
|
1412
|
+
</iso-standard>
|
1413
|
+
INPUT
|
1396
1414
|
word = File.read("test.doc")
|
1397
1415
|
.sub(/^.*<div class="WordSection2">/m, '<div class="WordSection2" xmlns:m="m">')
|
1398
1416
|
.sub(%r{<p class="MsoNormal">\s*<br clear="all" class="section"/>\s*</p>\s*<div class="WordSection3">.*$}m, "")
|
@@ -1439,21 +1457,23 @@ RSpec.describe IsoDoc do
|
|
1439
1457
|
it "propagates alignment of table cells (Word)" do
|
1440
1458
|
FileUtils.rm_f "test.doc"
|
1441
1459
|
FileUtils.rm_f "test.html"
|
1442
|
-
IsoDoc::WordConvert.new(
|
1443
|
-
|
1444
|
-
|
1445
|
-
|
1446
|
-
|
1447
|
-
|
1448
|
-
|
1449
|
-
|
1450
|
-
|
1451
|
-
|
1452
|
-
|
1453
|
-
|
1454
|
-
|
1455
|
-
|
1456
|
-
|
1460
|
+
IsoDoc::WordConvert.new(OPTIONS)
|
1461
|
+
.convert("test", <<~"INPUT", false)
|
1462
|
+
#{' '}
|
1463
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
1464
|
+
<preface><foreword>
|
1465
|
+
<table id="_fe12b8f8-6858-4cd6-af7d-d4b6f3ebd1a7" unnumbered="true"><thead><tr>
|
1466
|
+
<td rowspan="2" align="left">
|
1467
|
+
<p id="_c47d9b39-adb2-431d-9320-78cb148fdb56">Output wavelength</p>
|
1468
|
+
<p id="_c47d9b39-adb2-431d-9320-78cb148fdb57">Output wavelength</p>
|
1469
|
+
</td>
|
1470
|
+
<th colspan="3" align="right"><p id="_c47d9b39-adb2-431d-9320-78cb148fdb58">Predictive wavelengths</p></th>
|
1471
|
+
</tr>
|
1472
|
+
</thead>
|
1473
|
+
</table>
|
1474
|
+
</preface>
|
1475
|
+
</iso-standard>
|
1476
|
+
INPUT
|
1457
1477
|
word = File.read("test.doc")
|
1458
1478
|
.sub(/^.*<div class="WordSection2">/m, '<div class="WordSection2" xmlns:m="m">')
|
1459
1479
|
.sub(%r{<p class="MsoNormal">\s*<br clear="all" class="section"/>\s*</p>\s*<div class="WordSection3">.*$}m, "")
|
@@ -1580,7 +1600,7 @@ RSpec.describe IsoDoc do
|
|
1580
1600
|
FileUtils.rm_f "test.doc"
|
1581
1601
|
IsoDoc::WordConvert.new(
|
1582
1602
|
{ wordstylesheet: "spec/assets/word.css",
|
1583
|
-
htmlstylesheet: "spec/assets/html.scss", filename: "test" }
|
1603
|
+
htmlstylesheet: "spec/assets/html.scss", filename: "test" },
|
1584
1604
|
).convert("test", <<~"INPUT", false)
|
1585
1605
|
<standard-document xmlns="http://riboseinc.com/isoxml">
|
1586
1606
|
<bibdata type="standard">
|