isodoc 1.6.0 → 1.6.5
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/.github/workflows/rake.yml +2 -12
- data/.hound.yml +3 -1
- data/.rubocop.yml +4 -8
- data/Rakefile +2 -2
- data/bin/rspec +1 -2
- data/isodoc.gemspec +4 -3
- data/lib/isodoc-yaml/i18n-ar.yaml +152 -0
- data/lib/isodoc-yaml/i18n-de.yaml +149 -0
- data/lib/isodoc-yaml/i18n-en.yaml +1 -0
- data/lib/isodoc-yaml/i18n-es.yaml +151 -0
- data/lib/isodoc-yaml/i18n-fr.yaml +1 -0
- data/lib/isodoc-yaml/i18n-ru.yaml +154 -0
- data/lib/isodoc-yaml/i18n-zh-Hans.yaml +1 -0
- data/lib/isodoc.rb +0 -2
- data/lib/isodoc/common.rb +2 -0
- data/lib/isodoc/convert.rb +10 -4
- data/lib/isodoc/css.rb +30 -26
- data/lib/isodoc/function/blocks.rb +26 -8
- data/lib/isodoc/function/blocks_example_note.rb +2 -2
- data/lib/isodoc/function/cleanup.rb +53 -45
- data/lib/isodoc/function/form.rb +51 -0
- data/lib/isodoc/function/inline.rb +8 -7
- data/lib/isodoc/function/references.rb +71 -77
- data/lib/isodoc/function/section.rb +28 -16
- data/lib/isodoc/function/table.rb +22 -22
- data/lib/isodoc/function/terms.rb +6 -7
- data/lib/isodoc/function/to_word_html.rb +19 -25
- data/lib/isodoc/function/utils.rb +180 -160
- data/lib/isodoc/gem_tasks.rb +36 -38
- data/lib/isodoc/headlesshtml_convert.rb +8 -7
- data/lib/isodoc/html_convert.rb +10 -4
- data/lib/isodoc/html_function/comments.rb +14 -12
- data/lib/isodoc/html_function/footnotes.rb +14 -7
- data/lib/isodoc/html_function/form.rb +62 -0
- data/lib/isodoc/html_function/html.rb +30 -26
- data/lib/isodoc/html_function/postprocess.rb +191 -226
- data/lib/isodoc/html_function/postprocess_footnotes.rb +59 -0
- data/lib/isodoc/html_function/sectionsplit.rb +230 -0
- data/lib/isodoc/i18n.rb +33 -31
- data/lib/isodoc/metadata.rb +22 -20
- data/lib/isodoc/metadata_contributor.rb +31 -28
- data/lib/isodoc/pdf_convert.rb +11 -13
- data/lib/isodoc/presentation_function/bibdata.rb +54 -30
- data/lib/isodoc/presentation_function/block.rb +17 -8
- data/lib/isodoc/presentation_function/inline.rb +72 -120
- data/lib/isodoc/presentation_function/math.rb +84 -0
- data/lib/isodoc/presentation_function/section.rb +55 -19
- data/lib/isodoc/presentation_xml_convert.rb +2 -0
- data/lib/isodoc/sassc_importer.rb +1 -1
- data/lib/isodoc/version.rb +1 -1
- data/lib/isodoc/word_function/body.rb +28 -24
- data/lib/isodoc/word_function/footnotes.rb +22 -15
- data/lib/isodoc/word_function/postprocess.rb +50 -36
- data/lib/isodoc/xref.rb +11 -10
- data/lib/isodoc/xref/xref_counter.rb +32 -17
- data/lib/isodoc/xref/xref_gen.rb +33 -21
- data/lib/isodoc/xref/xref_gen_seq.rb +60 -35
- data/lib/isodoc/xref/xref_sect_gen.rb +37 -35
- data/spec/assets/scripts_override.html +3 -0
- data/spec/isodoc/blocks_spec.rb +2258 -2622
- data/spec/isodoc/cleanup_spec.rb +1103 -1107
- data/spec/isodoc/form_spec.rb +156 -0
- data/spec/isodoc/i18n_spec.rb +802 -917
- data/spec/isodoc/inline_spec.rb +1105 -921
- data/spec/isodoc/lists_spec.rb +316 -315
- data/spec/isodoc/metadata_spec.rb +384 -379
- data/spec/isodoc/postproc_spec.rb +1783 -1549
- data/spec/isodoc/presentation_xml_spec.rb +355 -278
- data/spec/isodoc/ref_spec.rb +718 -723
- data/spec/isodoc/section_spec.rb +216 -199
- data/spec/isodoc/sectionsplit_spec.rb +190 -0
- data/spec/isodoc/table_spec.rb +41 -42
- data/spec/isodoc/terms_spec.rb +84 -84
- data/spec/isodoc/xref_spec.rb +1024 -930
- metadata +33 -7
@@ -0,0 +1,190 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
RSpec.describe IsoDoc do
|
4
|
+
it "processes section split HTML" do
|
5
|
+
FileUtils.rm_f "test.xml"
|
6
|
+
FileUtils.rm_f "test.html.yaml"
|
7
|
+
FileUtils.rm_rf "test_collection"
|
8
|
+
FileUtils.rm_rf "test_files"
|
9
|
+
input = <<~INPUT
|
10
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
11
|
+
<bibdata>
|
12
|
+
<title>ISO Title</title>
|
13
|
+
<docidentifier type="ISO">ISO 1</docidentifier>
|
14
|
+
</bibdata>
|
15
|
+
<preface>
|
16
|
+
<abstract id="A" displayorder='1'><title>abstract</title></abstract>
|
17
|
+
<introduction id="B" displayorder='2'><title>introduction</title></introduction>
|
18
|
+
</preface>
|
19
|
+
<sections>
|
20
|
+
<clause id="M" inline-header="false" obligation="normative" displayorder='4'>
|
21
|
+
<title>Clause 4</title>
|
22
|
+
<clause id="N" inline-header="false" obligation="normative">
|
23
|
+
<title>Introduction</title>
|
24
|
+
<p><xref target="A">HE</xref></p>
|
25
|
+
<p><eref bibitemid="R1">SHE</xref></p>
|
26
|
+
<svgmap>
|
27
|
+
<figure>
|
28
|
+
<svg xmlns="http://www.w3.org/2000/svg">
|
29
|
+
<a href="#A">A</a>
|
30
|
+
<a href="#B">B</a>
|
31
|
+
</svg>
|
32
|
+
<target href="B"><eref bibitemid="R1"/></target>
|
33
|
+
</figure>
|
34
|
+
</svgmap>
|
35
|
+
<figure>
|
36
|
+
<svg xmlns="http://www.w3.org/2000/svg">
|
37
|
+
<a href="#P">P</a>
|
38
|
+
</svg>
|
39
|
+
</figure>
|
40
|
+
</clause>
|
41
|
+
<clause id="O" inline-header="true" obligation="normative">
|
42
|
+
<title>Clause 4.2</title>
|
43
|
+
</clause></clause>
|
44
|
+
<admonition id="L" type="caution"><p>admonition</p></admonition>
|
45
|
+
</sections>
|
46
|
+
<annex id="P" inline-header="false" obligation="normative" displayorder='5'>
|
47
|
+
<title><strong>Annex</strong><br/>(informative)</title>
|
48
|
+
<clause id="Q" inline-header="false" obligation="normative">
|
49
|
+
<title>Annex A.1</title>
|
50
|
+
<clause id="Q1" inline-header="false" obligation="normative">
|
51
|
+
<title>Annex A.1a</title>
|
52
|
+
</clause>
|
53
|
+
<references id="Q2" normative="false">
|
54
|
+
<title>Annex Bibliography</title>
|
55
|
+
</references>
|
56
|
+
</clause>
|
57
|
+
</annex>
|
58
|
+
<annex id="P1" inline-header="false" obligation="normative" displayorder='6'>
|
59
|
+
</annex>
|
60
|
+
<bibliography><references id="R" obligation="informative" normative="true" displayorder='3'>
|
61
|
+
<title>Normative References</title>
|
62
|
+
<bibitem id="R1"><docidentifier>R1</docidentifier><title>Hello</title></bibitem>
|
63
|
+
</references><clause id="S" obligation="informative" displayorder='7'>
|
64
|
+
<title>Bibliography</title>
|
65
|
+
<references id="T" obligation="informative" normative="false">
|
66
|
+
<title>Bibliography Subsection</title>
|
67
|
+
</references>
|
68
|
+
</clause>
|
69
|
+
</bibliography>
|
70
|
+
</iso-standard>
|
71
|
+
INPUT
|
72
|
+
mock_render
|
73
|
+
IsoDoc::HtmlConvert.new({ sectionsplit: "true" })
|
74
|
+
.convert("test", input, true)
|
75
|
+
expect(File.exist?("test_collection/index.html")).to be true
|
76
|
+
expect(File.exist?("test_collection/test.0.html")).to be true
|
77
|
+
expect(File.exist?("test_collection/test.1.html")).to be true
|
78
|
+
expect(File.exist?("test_collection/test.2.html")).to be true
|
79
|
+
expect(File.exist?("test_collection/test.3.html")).to be false
|
80
|
+
expect(File.exist?("test_collection/test.4.html")).to be true
|
81
|
+
expect(File.exist?("test_collection/test.5.html")).to be true
|
82
|
+
expect(File.exist?("test_collection/test.6.html")).to be true
|
83
|
+
expect(File.exist?("test_collection/test.7.html")).to be true
|
84
|
+
expect(File.exist?("test_collection/test.8.html")).to be false
|
85
|
+
expect(File.exist?("test_files/cover.html")).to be true
|
86
|
+
expect(File.exist?("test_files/test.0.xml")).to be true
|
87
|
+
expect(File.exist?("test_files/test.1.xml")).to be true
|
88
|
+
expect(File.exist?("test_files/test.2.xml")).to be true
|
89
|
+
expect(File.exist?("test_files/test.3.xml")).to be true
|
90
|
+
expect(File.exist?("test_files/test.4.xml")).to be true
|
91
|
+
expect(File.exist?("test_files/test.5.xml")).to be true
|
92
|
+
expect(File.exist?("test_files/test.6.xml")).to be true
|
93
|
+
expect(File.exist?("test_files/test.7.xml")).to be true
|
94
|
+
expect(File.exist?("test_files/test.8.xml")).to be false
|
95
|
+
expect(File.exist?("test_files/test.html.yaml")).to be true
|
96
|
+
m = /type="([^"]+)"/.match(File.read("test_files/test.0.xml"))
|
97
|
+
file2 = Nokogiri::XML(File.read("test_files/test.2.xml"))
|
98
|
+
expect(xmlpp(file2
|
99
|
+
.at("//xmlns:eref[@bibitemid = '#{m[1]}_A']").to_xml))
|
100
|
+
.to be_equivalent_to xmlpp(<<~OUTPUT)
|
101
|
+
<eref bibitemid="#{m[1]}_A" type="#{m[1]}">HE<localityStack><locality type="anchor"><referenceFrom>A</referenceFrom></locality></localityStack></eref>
|
102
|
+
OUTPUT
|
103
|
+
expect(xmlpp(file2
|
104
|
+
.at("//xmlns:eref[@bibitemid = '#{m[1]}_R1']").to_xml))
|
105
|
+
.to be_equivalent_to xmlpp(<<~OUTPUT)
|
106
|
+
<eref bibitemid="#{m[1]}_R1" type="#{m[1]}">SHE<localityStack><locality type="anchor"><referenceFrom>#{m[1]}_R1</referenceFrom></locality></localityStack></eref>
|
107
|
+
OUTPUT
|
108
|
+
expect(xmlpp(file2
|
109
|
+
.at("//xmlns:bibitem[@id = '#{m[1]}_R1']").to_xml))
|
110
|
+
.to be_equivalent_to xmlpp(<<~OUTPUT)
|
111
|
+
<bibitem id="#{m[1]}_R1" type="internal">
|
112
|
+
<docidentifier type="repository">#{m[1]}/R1</docidentifier>
|
113
|
+
</bibitem>
|
114
|
+
OUTPUT
|
115
|
+
expect(xmlpp(file2
|
116
|
+
.at("//xmlns:bibitem[@id = '#{m[1]}_A']").to_xml))
|
117
|
+
.to be_equivalent_to xmlpp(<<~OUTPUT)
|
118
|
+
<bibitem id="#{m[1]}_A" type="internal">
|
119
|
+
<docidentifier type="repository">#{m[1]}/A</docidentifier>
|
120
|
+
</bibitem>
|
121
|
+
OUTPUT
|
122
|
+
expect(xmlpp(file2
|
123
|
+
.at("//xmlns:svgmap[1]").to_xml))
|
124
|
+
.to be_equivalent_to xmlpp(<<~OUTPUT)
|
125
|
+
<svgmap>
|
126
|
+
<figure>
|
127
|
+
<svg xmlns="http://www.w3.org/2000/svg">
|
128
|
+
<a href="A">A</a>
|
129
|
+
<a href="B">B</a>
|
130
|
+
</svg>
|
131
|
+
<target href="B"><eref bibitemid="#{m[1]}_R1" type="#{m[1]}"><localityStack><locality type="anchor"><referenceFrom>#{m[1]}_R1</referenceFrom></locality></localityStack></eref></target>
|
132
|
+
</figure>
|
133
|
+
<target href="A"><eref bibitemid="#{m[1]}_A" type="#{m[1]}"><localityStack><locality type="anchor"><referenceFrom>A</referenceFrom></locality></localityStack></eref></target><target href="B"><eref bibitemid="#{m[1]}_B" type="#{m[1]}"><localityStack><locality type="anchor"><referenceFrom>B</referenceFrom></locality></localityStack></eref></target></svgmap>
|
134
|
+
OUTPUT
|
135
|
+
expect(xmlpp(file2
|
136
|
+
.at("//xmlns:svgmap[2]").to_xml))
|
137
|
+
.to be_equivalent_to xmlpp(<<~OUTPUT)
|
138
|
+
<svgmap><figure>
|
139
|
+
<svg xmlns="http://www.w3.org/2000/svg">
|
140
|
+
<a href="P">P</a>
|
141
|
+
</svg>
|
142
|
+
</figure><target href="P"><eref bibitemid="#{m[1]}_P" type="#{m[1]}"><localityStack><locality type="anchor"><referenceFrom>P</referenceFrom></locality></localityStack></eref></target></svgmap>
|
143
|
+
OUTPUT
|
144
|
+
expect(File.read("test_files/test.html.yaml")).to be_equivalent_to <<~OUTPUT
|
145
|
+
---
|
146
|
+
directives:
|
147
|
+
- presentation-xml
|
148
|
+
- bare-after-first
|
149
|
+
bibdata:
|
150
|
+
title:
|
151
|
+
type: title-main
|
152
|
+
language: en
|
153
|
+
content: ISO Title
|
154
|
+
type: collection
|
155
|
+
docid:
|
156
|
+
type: ISO
|
157
|
+
id: ISO 1
|
158
|
+
manifest:
|
159
|
+
level: collection
|
160
|
+
title: Collection
|
161
|
+
docref:
|
162
|
+
- fileref: test.3.xml
|
163
|
+
identifier: "[Untitled]"
|
164
|
+
- fileref: test.0.xml
|
165
|
+
identifier: abstract
|
166
|
+
- fileref: test.1.xml
|
167
|
+
identifier: introduction
|
168
|
+
- fileref: test.6.xml
|
169
|
+
identifier: Normative References
|
170
|
+
- fileref: test.2.xml
|
171
|
+
identifier: Clause 4
|
172
|
+
- fileref: test.4.xml
|
173
|
+
identifier: Annex (informative)
|
174
|
+
- fileref: test.5.xml
|
175
|
+
identifier: "[Untitled]"
|
176
|
+
- fileref: test.7.xml
|
177
|
+
identifier: Bibliography
|
178
|
+
OUTPUT
|
179
|
+
end
|
180
|
+
|
181
|
+
private
|
182
|
+
|
183
|
+
def mock_render
|
184
|
+
original_add = ::Metanorma::CollectionRenderer.method(:render)
|
185
|
+
allow(::Metanorma::CollectionRenderer)
|
186
|
+
.to receive(:render) do |col, opts|
|
187
|
+
original_add.call(col, opts.merge(compile: { no_install_fonts: true }))
|
188
|
+
end
|
189
|
+
end
|
190
|
+
end
|
data/spec/isodoc/table_spec.rb
CHANGED
@@ -62,7 +62,6 @@ RSpec.describe IsoDoc do
|
|
62
62
|
</dl>
|
63
63
|
<note><p>This is a table about rice</p></note>
|
64
64
|
</table>
|
65
|
-
#{' '}
|
66
65
|
<table id="tableD-2" unnumbered="true">
|
67
66
|
<tbody><tr><td>A</td></tr></tbody>
|
68
67
|
</table>
|
@@ -74,7 +73,7 @@ RSpec.describe IsoDoc do
|
|
74
73
|
presxml = <<~OUTPUT
|
75
74
|
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
76
75
|
<preface>
|
77
|
-
<foreword>
|
76
|
+
<foreword displayorder="1">
|
78
77
|
<table id='tableD-1' alt='tool tip' summary='long desc' width='70%' keep-with-next='true' keep-lines-together='true'>
|
79
78
|
<name>
|
80
79
|
Table 1 — Repeatability and reproducibility of
|
@@ -406,46 +405,46 @@ RSpec.describe IsoDoc do
|
|
406
405
|
<thead>
|
407
406
|
<tr>
|
408
407
|
<td>
|
409
|
-
Description Description Description Description Description Description Description Description Description
|
410
|
-
Description Description Description Description Description Description Description Description Description
|
411
|
-
Description Description Description Description Description Description Description Description Description
|
412
|
-
Description Description Description Description Description Description Description Description Description
|
413
|
-
Description Description Description Description Description Description Description Description Description
|
414
|
-
Description Description Description Description Description Description Description Description Description
|
415
|
-
Description Description Description Description Description Description Description Description Description
|
416
|
-
Description Description Description Description Description Description Description Description Description
|
417
|
-
Description Description Description Description Description Description Description Description Description
|
418
|
-
Description Description Description Description Description Description Description Description Description
|
419
|
-
Description Description Description Description Description Description Description Description Description
|
420
|
-
Description Description Description Description Description Description Description Description Description
|
421
|
-
Description Description Description Description Description Description Description Description Description
|
422
|
-
Description Description Description Description Description Description Description Description Description
|
423
|
-
Description Description Description Description Description Description Description Description Description
|
424
|
-
Description Description Description Description Description Description Description Description Description
|
425
|
-
Description Description Description Description Description Description Description Description Description
|
426
|
-
Description Description Description Description Description Description Description Description Description
|
427
|
-
Description Description Description Description Description Description Description Description Description
|
428
|
-
Description Description Description Description Description Description Description Description Description
|
429
|
-
Description Description Description Description Description Description Description Description Description
|
430
|
-
Description Description Description Description Description Description Description Description Description
|
431
|
-
Description Description Description Description Description Description Description Description Description
|
432
|
-
Description Description Description Description Description Description Description Description Description
|
433
|
-
Description Description Description Description Description Description Description Description Description
|
434
|
-
Description Description Description Description Description Description Description Description Description
|
435
|
-
Description Description Description Description Description Description Description Description Description
|
436
|
-
Description Description Description Description Description Description Description Description Description
|
437
|
-
Description Description Description Description Description Description Description Description Description
|
438
|
-
Description Description Description Description Description Description Description Description Description
|
439
|
-
Description Description Description Description Description Description Description Description Description
|
440
|
-
Description Description Description Description Description Description Description Description Description
|
441
|
-
Description Description Description Description Description Description Description Description Description
|
442
|
-
Description Description Description Description Description Description Description Description Description
|
443
|
-
Description Description Description Description Description Description Description Description Description
|
444
|
-
Description Description Description Description Description Description Description Description Description
|
445
|
-
Description Description Description Description Description Description Description Description Description
|
446
|
-
Description Description Description Description Description Description Description Description Description
|
447
|
-
Description Description Description Description Description Description Description Description Description
|
448
|
-
Description Description Description Description Description Description Description Description Description
|
408
|
+
Description Description Description Description Description Description Description Description Description
|
409
|
+
Description Description Description Description Description Description Description Description Description
|
410
|
+
Description Description Description Description Description Description Description Description Description
|
411
|
+
Description Description Description Description Description Description Description Description Description
|
412
|
+
Description Description Description Description Description Description Description Description Description
|
413
|
+
Description Description Description Description Description Description Description Description Description
|
414
|
+
Description Description Description Description Description Description Description Description Description
|
415
|
+
Description Description Description Description Description Description Description Description Description
|
416
|
+
Description Description Description Description Description Description Description Description Description
|
417
|
+
Description Description Description Description Description Description Description Description Description
|
418
|
+
Description Description Description Description Description Description Description Description Description
|
419
|
+
Description Description Description Description Description Description Description Description Description
|
420
|
+
Description Description Description Description Description Description Description Description Description
|
421
|
+
Description Description Description Description Description Description Description Description Description
|
422
|
+
Description Description Description Description Description Description Description Description Description
|
423
|
+
Description Description Description Description Description Description Description Description Description
|
424
|
+
Description Description Description Description Description Description Description Description Description
|
425
|
+
Description Description Description Description Description Description Description Description Description
|
426
|
+
Description Description Description Description Description Description Description Description Description
|
427
|
+
Description Description Description Description Description Description Description Description Description
|
428
|
+
Description Description Description Description Description Description Description Description Description
|
429
|
+
Description Description Description Description Description Description Description Description Description
|
430
|
+
Description Description Description Description Description Description Description Description Description
|
431
|
+
Description Description Description Description Description Description Description Description Description
|
432
|
+
Description Description Description Description Description Description Description Description Description
|
433
|
+
Description Description Description Description Description Description Description Description Description
|
434
|
+
Description Description Description Description Description Description Description Description Description
|
435
|
+
Description Description Description Description Description Description Description Description Description
|
436
|
+
Description Description Description Description Description Description Description Description Description
|
437
|
+
Description Description Description Description Description Description Description Description Description
|
438
|
+
Description Description Description Description Description Description Description Description Description
|
439
|
+
Description Description Description Description Description Description Description Description Description
|
440
|
+
Description Description Description Description Description Description Description Description Description
|
441
|
+
Description Description Description Description Description Description Description Description Description
|
442
|
+
Description Description Description Description Description Description Description Description Description
|
443
|
+
Description Description Description Description Description Description Description Description Description
|
444
|
+
Description Description Description Description Description Description Description Description Description
|
445
|
+
Description Description Description Description Description Description Description Description Description
|
446
|
+
Description Description Description Description Description Description Description Description Description
|
447
|
+
Description Description Description Description Description Description Description Description Description
|
449
448
|
</td>
|
450
449
|
<td>Rice sample</td>
|
451
450
|
</tr>
|
data/spec/isodoc/terms_spec.rb
CHANGED
@@ -69,7 +69,7 @@ RSpec.describe IsoDoc do
|
|
69
69
|
presxml = <<~"PRESXML"
|
70
70
|
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
71
71
|
<sections>
|
72
|
-
<terms id='_terms_and_definitions' obligation='normative'>
|
72
|
+
<terms id='_terms_and_definitions' obligation='normative' displayorder="1">
|
73
73
|
<title depth='1'>
|
74
74
|
1.
|
75
75
|
<tab/>
|
@@ -166,93 +166,93 @@ RSpec.describe IsoDoc do
|
|
166
166
|
PRESXML
|
167
167
|
|
168
168
|
html = <<~"OUTPUT"
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
169
|
+
#{HTML_HDR}
|
170
|
+
<p class="zzSTDTitle1"/>
|
171
|
+
<div id="_terms_and_definitions">
|
172
|
+
<h1> 1.   Terms and Definitions </h1>
|
173
|
+
<p>For the purposes of this document,
|
174
|
+
the following terms and definitions apply.</p>
|
175
|
+
<p class="TermNum" id="paddy1">1.1.</p><p class="Terms" style="text-align:left;">paddy</p>
|
176
|
+
<p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f"><rice> rice retaining its husk after threshing</p>
|
177
|
+
<div id="_bd57bbf1-f948-4bae-b0ce-73c00431f892" class="example" style='page-break-after: avoid;page-break-inside: avoid;'><p class="example-title">EXAMPLE 1</p>
|
178
|
+
<p id="_65c9a509-9a89-4b54-a890-274126aeb55c">Foreign seeds, husks, bran, sand, dust.</p>
|
179
|
+
<ul>
|
180
|
+
<li>A</li>
|
181
|
+
</ul>
|
182
|
+
</div>
|
183
|
+
<div id="_bd57bbf1-f948-4bae-b0ce-73c00431f894" class="example"><p class="example-title">EXAMPLE 2</p>
|
184
|
+
<ul>
|
185
|
+
<li>A</li>
|
186
|
+
</ul>
|
187
|
+
</div>
|
188
|
+
<p>[TERMREF]
|
189
|
+
<a href="#ISO7301">ISO 7301:2011, Clause 3.1</a>
|
190
|
+
[MODIFICATION] The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here
|
191
|
+
[/TERMREF]</p>
|
192
|
+
<p>[TERMREF] Termbase IEV, term ID xyz [/TERMREF]</p>
|
193
|
+
<p>[TERMREF] Termbase IEV, term ID xyz [MODIFICATION]with adjustments [/TERMREF]</p>
|
194
|
+
<p class="TermNum" id="paddy">1.2.</p><p class="Terms" style="text-align:left;">paddy</p><p class="AltTerms" style="text-align:left;">paddy rice</p>
|
195
|
+
<p class="AltTerms" style="text-align:left;">rough rice</p>
|
196
|
+
<p class="DeprecatedTerms" style="text-align:left;">DEPRECATED: cargo rice</p>
|
197
|
+
<p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p>
|
198
|
+
<div id="_bd57bbf1-f948-4bae-b0ce-73c00431f893" class="example"><p class="example-title">EXAMPLE</p>
|
199
|
+
<ul>
|
200
|
+
<li>A</li>
|
201
|
+
</ul>
|
202
|
+
</div>
|
203
|
+
<div class="Note" id='_671a1994-4783-40d0-bc81-987d06ffb74e' style='page-break-after: avoid;page-break-inside: avoid;'><p>Note 1 to entry: The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.</p></div>
|
204
|
+
<div class="Note" id='_671a1994-4783-40d0-bc81-987d06ffb74f'><p>Note 2 to entry: <ul><li>A</li></ul><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></p></div>
|
205
|
+
<p>[TERMREF]
|
206
|
+
<a href='#ISO7301'>ISO 7301:2011, 3.1</a>
|
207
|
+
<a href='#ISO7301'>ISO 7301:2011, clause 3.1</a>
|
208
|
+
[/TERMREF]</p></div>
|
182
209
|
</div>
|
183
|
-
|
184
|
-
|
185
|
-
<li>A</li>
|
186
|
-
</ul>
|
187
|
-
</div>
|
188
|
-
<p>[TERMREF]
|
189
|
-
<a href="#ISO7301">ISO 7301:2011, Clause 3.1</a>
|
190
|
-
[MODIFICATION] The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here
|
191
|
-
[/TERMREF]</p>
|
192
|
-
<p>[TERMREF] Termbase IEV, term ID xyz [/TERMREF]</p>
|
193
|
-
<p>[TERMREF] Termbase IEV, term ID xyz [MODIFICATION]with adjustments [/TERMREF]</p>
|
194
|
-
<p class="TermNum" id="paddy">1.2.</p><p class="Terms" style="text-align:left;">paddy</p><p class="AltTerms" style="text-align:left;">paddy rice</p>
|
195
|
-
<p class="AltTerms" style="text-align:left;">rough rice</p>
|
196
|
-
<p class="DeprecatedTerms" style="text-align:left;">DEPRECATED: cargo rice</p>
|
197
|
-
<p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p>
|
198
|
-
<div id="_bd57bbf1-f948-4bae-b0ce-73c00431f893" class="example"><p class="example-title">EXAMPLE</p>
|
199
|
-
<ul>
|
200
|
-
<li>A</li>
|
201
|
-
</ul>
|
202
|
-
</div>
|
203
|
-
<div class="Note" id='_671a1994-4783-40d0-bc81-987d06ffb74e' style='page-break-after: avoid;page-break-inside: avoid;'><p>Note 1 to entry: The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.</p></div>
|
204
|
-
<div class="Note" id='_671a1994-4783-40d0-bc81-987d06ffb74f'><p>Note 2 to entry: <ul><li>A</li></ul><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></p></div>
|
205
|
-
<p>[TERMREF]
|
206
|
-
<a href='#ISO7301'>ISO 7301:2011, 3.1</a>
|
207
|
-
<a href='#ISO7301'>ISO 7301:2011, clause 3.1</a>
|
208
|
-
[/TERMREF]</p></div>
|
209
|
-
</div>
|
210
|
-
</body>
|
211
|
-
</html>
|
210
|
+
</body>
|
211
|
+
</html>
|
212
212
|
OUTPUT
|
213
213
|
|
214
214
|
word = <<~"WORD"
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
215
|
+
#{WORD_HDR}
|
216
|
+
<p class="zzSTDTitle1"/>
|
217
|
+
<div id="_terms_and_definitions"><h1>1.<span style="mso-tab-count:1">  </span>Terms and Definitions</h1><p>For the purposes of this document,
|
218
|
+
the following terms and definitions apply.</p>
|
219
|
+
<p class="TermNum" id="paddy1">1.1.</p><p class="Terms" style="text-align:left;">paddy</p>
|
220
|
+
<p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f"><rice> rice retaining its husk after threshing</p>
|
221
|
+
<div id="_bd57bbf1-f948-4bae-b0ce-73c00431f892" class="example" style='page-break-after: avoid;page-break-inside: avoid;'><p class="example-title">EXAMPLE 1</p>
|
222
|
+
<p id="_65c9a509-9a89-4b54-a890-274126aeb55c">Foreign seeds, husks, bran, sand, dust.</p>
|
223
|
+
<ul>
|
224
|
+
<li>A</li>
|
225
|
+
</ul>
|
226
|
+
</div>
|
227
|
+
<div id="_bd57bbf1-f948-4bae-b0ce-73c00431f894" class="example"><p class="example-title">EXAMPLE 2</p>
|
228
|
+
<ul>
|
229
|
+
<li>A</li>
|
230
|
+
</ul>
|
231
|
+
</div>
|
232
|
+
<p>[TERMREF]
|
233
|
+
<a href="#ISO7301">ISO 7301:2011, Clause 3.1</a>
|
234
|
+
[MODIFICATION] The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here
|
235
|
+
[/TERMREF]</p>
|
236
|
+
<p>[TERMREF] Termbase IEV, term ID xyz [/TERMREF]</p>
|
237
|
+
<p>[TERMREF] Termbase IEV, term ID xyz [MODIFICATION]with adjustments [/TERMREF]</p>
|
238
|
+
<p class="TermNum" id="paddy">1.2.</p><p class="Terms" style="text-align:left;">paddy</p><p class="AltTerms" style="text-align:left;">paddy rice</p>
|
239
|
+
<p class="AltTerms" style="text-align:left;">rough rice</p>
|
240
|
+
<p class="DeprecatedTerms" style="text-align:left;">DEPRECATED: cargo rice</p>
|
241
|
+
<p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p>
|
242
|
+
<div id="_bd57bbf1-f948-4bae-b0ce-73c00431f893" class="example"><p class="example-title">EXAMPLE</p>
|
243
|
+
<ul>
|
244
|
+
<li>A</li>
|
245
|
+
</ul>
|
246
|
+
</div>
|
247
|
+
<div id='_671a1994-4783-40d0-bc81-987d06ffb74e' class="Note" style='page-break-after: avoid;page-break-inside: avoid;'><p class="Note">Note 1 to entry: The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.</p></div>
|
248
|
+
<div id='_671a1994-4783-40d0-bc81-987d06ffb74f' class="Note"><p class="Note">Note 2 to entry: <ul><li>A</li></ul><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></p></div>
|
249
|
+
<p>[TERMREF]
|
250
|
+
<a href='#ISO7301'>ISO 7301:2011, 3.1</a>
|
251
|
+
<a href='#ISO7301'>ISO 7301:2011, clause 3.1</a>
|
252
|
+
[/TERMREF]</p></div>
|
253
|
+
</div>
|
254
|
+
</body>
|
255
|
+
</html>
|
256
256
|
WORD
|
257
257
|
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
|
258
258
|
.convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
|