isodoc 1.6.3 → 1.6.7.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/rake.yml +2 -12
  3. data/.hound.yml +3 -1
  4. data/.rubocop.yml +4 -6
  5. data/isodoc.gemspec +3 -2
  6. data/lib/isodoc-yaml/i18n-en.yaml +1 -0
  7. data/lib/isodoc-yaml/i18n-fr.yaml +1 -0
  8. data/lib/isodoc-yaml/i18n-zh-Hans.yaml +1 -0
  9. data/lib/isodoc.rb +0 -2
  10. data/lib/isodoc/convert.rb +7 -1
  11. data/lib/isodoc/function/blocks.rb +5 -4
  12. data/lib/isodoc/function/cleanup.rb +52 -43
  13. data/lib/isodoc/function/inline.rb +7 -7
  14. data/lib/isodoc/function/references.rb +33 -52
  15. data/lib/isodoc/function/section.rb +28 -16
  16. data/lib/isodoc/function/table.rb +21 -22
  17. data/lib/isodoc/function/terms.rb +6 -7
  18. data/lib/isodoc/function/to_word_html.rb +6 -3
  19. data/lib/isodoc/function/utils.rb +181 -163
  20. data/lib/isodoc/gem_tasks.rb +8 -9
  21. data/lib/isodoc/headlesshtml_convert.rb +8 -7
  22. data/lib/isodoc/html_convert.rb +5 -1
  23. data/lib/isodoc/html_function/comments.rb +14 -12
  24. data/lib/isodoc/html_function/footnotes.rb +14 -7
  25. data/lib/isodoc/html_function/html.rb +30 -26
  26. data/lib/isodoc/html_function/postprocess.rb +191 -182
  27. data/lib/isodoc/html_function/sectionsplit.rb +230 -0
  28. data/lib/isodoc/metadata.rb +22 -20
  29. data/lib/isodoc/metadata_contributor.rb +31 -28
  30. data/lib/isodoc/pdf_convert.rb +11 -13
  31. data/lib/isodoc/presentation_function/bibdata.rb +50 -22
  32. data/lib/isodoc/presentation_function/inline.rb +20 -15
  33. data/lib/isodoc/presentation_function/section.rb +38 -1
  34. data/lib/isodoc/presentation_xml_convert.rb +2 -0
  35. data/lib/isodoc/version.rb +1 -1
  36. data/lib/isodoc/word_function/postprocess.rb +50 -36
  37. data/lib/isodoc/xref.rb +2 -0
  38. data/lib/isodoc/xref/xref_gen_seq.rb +60 -35
  39. data/lib/isodoc/xref/xref_sect_gen.rb +4 -4
  40. data/spec/assets/scripts_override.html +3 -0
  41. data/spec/isodoc/blocks_spec.rb +373 -685
  42. data/spec/isodoc/cleanup_spec.rb +40 -42
  43. data/spec/isodoc/i18n_spec.rb +694 -821
  44. data/spec/isodoc/inline_spec.rb +482 -328
  45. data/spec/isodoc/metadata_spec.rb +384 -379
  46. data/spec/isodoc/postproc_spec.rb +163 -55
  47. data/spec/isodoc/presentation_xml_spec.rb +355 -278
  48. data/spec/isodoc/ref_spec.rb +5 -5
  49. data/spec/isodoc/section_spec.rb +216 -199
  50. data/spec/isodoc/sectionsplit_spec.rb +190 -0
  51. data/spec/isodoc/table_spec.rb +41 -42
  52. data/spec/isodoc/terms_spec.rb +84 -84
  53. data/spec/isodoc/xref_spec.rb +974 -932
  54. metadata +22 -5
@@ -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
@@ -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&#xA0;&#x2014; 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>
@@ -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
- #{HTML_HDR}
170
- <p class="zzSTDTitle1"/>
171
- <div id="_terms_and_definitions">
172
- <h1> 1. &#160; 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">&lt;rice&gt; 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>
169
+ #{HTML_HDR}
170
+ <p class="zzSTDTitle1"/>
171
+ <div id="_terms_and_definitions">
172
+ <h1> 1. &#160; 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">&lt;rice&gt; 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
- <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>
209
- </div>
210
- </body>
211
- </html>
210
+ </body>
211
+ </html>
212
212
  OUTPUT
213
213
 
214
214
  word = <<~"WORD"
215
- #{WORD_HDR}
216
- <p class="zzSTDTitle1"/>
217
- <div id="_terms_and_definitions"><h1>1.<span style="mso-tab-count:1">&#160; </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">&lt;rice&gt; 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>
215
+ #{WORD_HDR}
216
+ <p class="zzSTDTitle1"/>
217
+ <div id="_terms_and_definitions"><h1>1.<span style="mso-tab-count:1">&#160; </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">&lt;rice&gt; 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)