isodoc 1.5.4 → 1.6.3

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.
Files changed (74) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +6 -4
  3. data/Gemfile +2 -2
  4. data/Rakefile +2 -2
  5. data/bin/rspec +1 -2
  6. data/isodoc.gemspec +11 -11
  7. data/lib/isodoc-yaml/i18n-ar.yaml +152 -0
  8. data/lib/isodoc-yaml/i18n-de.yaml +149 -0
  9. data/lib/isodoc-yaml/i18n-es.yaml +151 -0
  10. data/lib/isodoc-yaml/i18n-ru.yaml +154 -0
  11. data/lib/isodoc/base_style/all.css +7 -0
  12. data/lib/isodoc/base_style/metanorma_word.css +7 -0
  13. data/lib/isodoc/base_style/metanorma_word.scss +8 -0
  14. data/lib/isodoc/base_style/reset.css +7 -0
  15. data/lib/isodoc/base_style/reset.scss +9 -0
  16. data/lib/isodoc/base_style/scripts.html +187 -0
  17. data/lib/isodoc/class_utils.rb +6 -5
  18. data/lib/isodoc/common.rb +2 -0
  19. data/lib/isodoc/convert.rb +30 -17
  20. data/lib/isodoc/css.rb +42 -28
  21. data/lib/isodoc/function/blocks.rb +21 -4
  22. data/lib/isodoc/function/blocks_example_note.rb +2 -2
  23. data/lib/isodoc/function/cleanup.rb +1 -2
  24. data/lib/isodoc/function/form.rb +51 -0
  25. data/lib/isodoc/function/inline.rb +32 -10
  26. data/lib/isodoc/function/references.rb +55 -42
  27. data/lib/isodoc/function/table.rb +1 -0
  28. data/lib/isodoc/function/to_word_html.rb +29 -28
  29. data/lib/isodoc/function/utils.rb +41 -38
  30. data/lib/isodoc/gem_tasks.rb +30 -31
  31. data/lib/isodoc/html_convert.rb +6 -4
  32. data/lib/isodoc/html_function/form.rb +62 -0
  33. data/lib/isodoc/html_function/postprocess.rb +35 -76
  34. data/lib/isodoc/html_function/postprocess_footnotes.rb +59 -0
  35. data/lib/isodoc/i18n.rb +33 -31
  36. data/lib/isodoc/pdf_convert.rb +1 -3
  37. data/lib/isodoc/presentation_function/bibdata.rb +13 -10
  38. data/lib/isodoc/presentation_function/block.rb +17 -8
  39. data/lib/isodoc/presentation_function/inline.rb +75 -118
  40. data/lib/isodoc/presentation_function/math.rb +84 -0
  41. data/lib/isodoc/presentation_function/section.rb +20 -22
  42. data/lib/isodoc/presentation_xml_convert.rb +2 -1
  43. data/lib/isodoc/sassc_importer.rb +1 -1
  44. data/lib/isodoc/version.rb +1 -1
  45. data/lib/isodoc/word_function/body.rb +28 -24
  46. data/lib/isodoc/word_function/footnotes.rb +22 -15
  47. data/lib/isodoc/word_function/postprocess.rb +16 -6
  48. data/lib/isodoc/xref.rb +10 -11
  49. data/lib/isodoc/xref/xref_counter.rb +32 -17
  50. data/lib/isodoc/xref/xref_gen.rb +45 -32
  51. data/lib/isodoc/xref/xref_sect_gen.rb +33 -31
  52. data/lib/isodoc/xslfo_convert.rb +36 -25
  53. data/spec/assets/html_override.css +1 -0
  54. data/spec/assets/word_override.css +1 -0
  55. data/spec/isodoc/blocks_spec.rb +2518 -2570
  56. data/spec/isodoc/cleanup_spec.rb +1107 -1109
  57. data/spec/isodoc/footnotes_spec.rb +1 -16
  58. data/spec/isodoc/form_spec.rb +156 -0
  59. data/spec/isodoc/i18n_spec.rb +984 -972
  60. data/spec/isodoc/inline_spec.rb +984 -920
  61. data/spec/isodoc/lists_spec.rb +316 -315
  62. data/spec/isodoc/postproc_spec.rb +1692 -1538
  63. data/spec/isodoc/presentation_xml_spec.rb +345 -342
  64. data/spec/isodoc/ref_spec.rb +718 -723
  65. data/spec/isodoc/section_spec.rb +910 -902
  66. data/spec/isodoc/table_spec.rb +566 -556
  67. data/spec/isodoc/terms_spec.rb +252 -256
  68. data/spec/isodoc/xref_spec.rb +3040 -2985
  69. data/spec/isodoc/xslfo_convert_spec.rb +39 -0
  70. data/spec/spec_helper.rb +30 -29
  71. metadata +80 -70
  72. data/.rubocop.ribose.yml +0 -65
  73. data/.rubocop.tb.yml +0 -650
  74. data/lib/twitter-cldr/patch.rb +0 -39
@@ -3,266 +3,262 @@ require "spec_helper"
3
3
  RSpec.describe IsoDoc do
4
4
  it "processes IsoXML terms" do
5
5
  input = <<~"INPUT"
6
- <iso-standard xmlns="http://riboseinc.com/isoxml">
7
- <sections>
8
- <terms id="_terms_and_definitions" obligation="normative"><title>Terms and Definitions</title>
9
- <p>For the purposes of this document, the following terms and definitions apply.</p>
10
-
11
- <term id="paddy1"><preferred>paddy</preferred>
12
- <domain>rice</domain>
13
- <definition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p></definition>
14
- <termexample id="_bd57bbf1-f948-4bae-b0ce-73c00431f892" keep-with-next="true" keep-lines-together="true">
15
- <p id="_65c9a509-9a89-4b54-a890-274126aeb55c">Foreign seeds, husks, bran, sand, dust.</p>
16
- <ul>
17
- <li>A</li>
18
- </ul>
19
- </termexample>
20
- <termexample id="_bd57bbf1-f948-4bae-b0ce-73c00431f894">
21
- <ul>
22
- <li>A</li>
23
- </ul>
24
- </termexample>
25
-
26
- <termsource status="modified">
27
- <origin bibitemid="ISO7301" type="inline" citeas="ISO 7301:2011"><locality type="clause"><referenceFrom>3.1</referenceFrom></locality></origin>
28
- <modification>
29
- <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>
30
- </modification>
31
- </termsource>
32
-
33
- <termsource status='identical'>
34
- <origin citeas=''>
35
- <termref base='IEV' target='xyz'>t1</termref>
36
- </origin>
37
- </termsource>
38
-
39
- <termsource status='modified'>
40
- <origin citeas=''>
41
- <termref base='IEV' target='xyz'/>
42
- </origin>
43
- <modification>
44
- <p id='_'>with adjustments</p>
45
- </modification>
46
- </termsource>
47
-
48
-
49
-
50
- </term>
51
-
52
- <term id="paddy"><preferred>paddy</preferred><admitted>paddy rice</admitted>
53
- <admitted>rough rice</admitted>
54
- <deprecates>cargo rice</deprecates>
55
- <definition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p></definition>
56
- <termexample id="_bd57bbf1-f948-4bae-b0ce-73c00431f893">
57
- <ul>
58
- <li>A</li>
59
- </ul>
60
- </termexample>
61
- <termnote id="_671a1994-4783-40d0-bc81-987d06ffb74e" keep-with-next="true" keep-lines-together="true">
62
- <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>
63
- </termnote>
64
- <termnote id="_671a1994-4783-40d0-bc81-987d06ffb74f">
65
- <ul><li>A</li></ul>
66
- <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>
67
- </termnote>
68
- <termsource status="identical">
69
- <origin bibitemid="ISO7301" type="inline" citeas="ISO 7301:2011"><locality type="clause"><referenceFrom>3.1</referenceFrom></locality></origin>
70
- </termsource></term>
71
- </terms>
72
- </sections>
73
- </iso-standard>
6
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
7
+ <sections>
8
+ <terms id="_terms_and_definitions" obligation="normative"><title>Terms and Definitions</title>
9
+ <p>For the purposes of this document, the following terms and definitions apply.</p>
10
+ <term id="paddy1"><preferred>paddy</preferred>
11
+ <domain>rice</domain>
12
+ <definition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p></definition>
13
+ <termexample id="_bd57bbf1-f948-4bae-b0ce-73c00431f892" keep-with-next="true" keep-lines-together="true">
14
+ <p id="_65c9a509-9a89-4b54-a890-274126aeb55c">Foreign seeds, husks, bran, sand, dust.</p>
15
+ <ul>
16
+ <li>A</li>
17
+ </ul>
18
+ </termexample>
19
+ <termexample id="_bd57bbf1-f948-4bae-b0ce-73c00431f894">
20
+ <ul>
21
+ <li>A</li>
22
+ </ul>
23
+ </termexample>
24
+ <termsource status="modified">
25
+ <origin bibitemid="ISO7301" type="inline" citeas="ISO 7301:2011"><locality type="clause"><referenceFrom>3.1</referenceFrom></locality></origin>
26
+ <modification>
27
+ <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>
28
+ </modification>
29
+ </termsource>
30
+ <termsource status='identical'>
31
+ <origin citeas=''>
32
+ <termref base='IEV' target='xyz'>t1</termref>
33
+ </origin>
34
+ </termsource>
35
+ <termsource status='modified'>
36
+ <origin citeas=''>
37
+ <termref base='IEV' target='xyz'/>
38
+ </origin>
39
+ <modification>
40
+ <p id='_'>with adjustments</p>
41
+ </modification>
42
+ </termsource>
43
+ </term>
44
+ <term id="paddy"><preferred>paddy</preferred><admitted>paddy rice</admitted>
45
+ <admitted>rough rice</admitted>
46
+ <deprecates>cargo rice</deprecates>
47
+ <definition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p></definition>
48
+ <termexample id="_bd57bbf1-f948-4bae-b0ce-73c00431f893">
49
+ <ul>
50
+ <li>A</li>
51
+ </ul>
52
+ </termexample>
53
+ <termnote id="_671a1994-4783-40d0-bc81-987d06ffb74e" keep-with-next="true" keep-lines-together="true">
54
+ <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>
55
+ </termnote>
56
+ <termnote id="_671a1994-4783-40d0-bc81-987d06ffb74f">
57
+ <ul><li>A</li></ul>
58
+ <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>
59
+ </termnote>
60
+ <termsource status="identical">
61
+ <origin bibitemid="ISO7301" type="inline" droploc="true" citeas="ISO 7301:2011"><locality type="clause"><referenceFrom>3.1</referenceFrom></locality></origin>
62
+ <origin bibitemid="ISO7301" type="inline" case="lowercase" citeas="ISO 7301:2011"><locality type="clause"><referenceFrom>3.1</referenceFrom></locality></origin>
63
+ </termsource></term>
64
+ </terms>
65
+ </sections>
66
+ </iso-standard>
74
67
  INPUT
75
68
 
76
69
  presxml = <<~"PRESXML"
77
- <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
78
- <sections>
79
- <terms id='_terms_and_definitions' obligation='normative'>
80
- <title depth='1'>
81
- 1.
82
- <tab/>
83
- Terms and Definitions
84
- </title>
85
- <p>For the purposes of this document, the following terms and definitions apply.</p>
86
- <term id='paddy1'><name>1.1.</name>
87
- <preferred>paddy</preferred>
88
- <domain>rice</domain>
89
- <definition>
90
- <p id='_eb29b35e-123e-4d1c-b50b-2714d41e747f'>rice retaining its husk after threshing</p>
91
- </definition>
92
- <termexample id='_bd57bbf1-f948-4bae-b0ce-73c00431f892' keep-with-next='true' keep-lines-together='true'>
93
- <name>EXAMPLE 1</name>
94
- <p id='_65c9a509-9a89-4b54-a890-274126aeb55c'>Foreign seeds, husks, bran, sand, dust.</p>
95
- <ul>
96
- <li>A</li>
97
- </ul>
98
- </termexample>
99
- <termexample id='_bd57bbf1-f948-4bae-b0ce-73c00431f894'>
100
- <name>EXAMPLE 2</name>
101
- <ul>
102
- <li>A</li>
103
- </ul>
104
- </termexample>
105
- <termsource status='modified'>
106
- <origin bibitemid='ISO7301' type='inline' citeas='ISO 7301:2011'><locality type='clause'>
107
- <referenceFrom>3.1</referenceFrom>
108
- </locality>ISO 7301:2011, Clause 3.1</origin>
109
- <modification>
110
- <p id='_e73a417d-ad39-417d-a4c8-20e4e2529489'>
111
- The term "cargo rice" is shown as deprecated, and Note 1 to entry
112
- is not included here
113
- </p>
114
- </modification>
115
- </termsource>
116
- <termsource status='identical'>
117
- <origin citeas=''>
118
- <termref base='IEV' target='xyz'>t1</termref>
119
- </origin>
120
- </termsource>
121
- <termsource status='modified'>
122
- <origin citeas=''>
123
- <termref base='IEV' target='xyz'/>
124
- </origin>
125
- <modification>
126
- <p id='_'>with adjustments</p>
127
- </modification>
128
- </termsource>
129
- </term>
130
- <term id='paddy'><name>1.2.</name>
131
- <preferred>paddy</preferred>
132
- <admitted>paddy rice</admitted>
133
- <admitted>rough rice</admitted>
134
- <deprecates>cargo rice</deprecates>
135
- <definition>
136
- <p id='_eb29b35e-123e-4d1c-b50b-2714d41e747f'>rice retaining its husk after threshing</p>
137
- </definition>
138
- <termexample id='_bd57bbf1-f948-4bae-b0ce-73c00431f893'>
139
- <name>EXAMPLE</name>
140
- <ul>
141
- <li>A</li>
142
- </ul>
143
- </termexample>
144
- <termnote id='_671a1994-4783-40d0-bc81-987d06ffb74e' keep-with-next='true' keep-lines-together='true'>
145
- <name>Note 1 to entry</name>
146
- <p id='_19830f33-e46c-42cc-94ca-a5ef101132d5'>
147
- The starch of waxy rice consists almost entirely of amylopectin. The
148
- kernels have a tendency to stick together after cooking.
149
- </p>
150
- </termnote>
151
- <termnote id='_671a1994-4783-40d0-bc81-987d06ffb74f'>
152
- <name>Note 2 to entry</name>
153
- <ul>
154
- <li>A</li>
155
- </ul>
156
- <p id='_19830f33-e46c-42cc-94ca-a5ef101132d5'>
157
- The starch of waxy rice consists almost entirely of amylopectin. The
158
- kernels have a tendency to stick together after cooking.
159
- </p>
160
- </termnote>
161
- <termsource status='identical'>
162
- <origin bibitemid='ISO7301' type='inline' citeas='ISO 7301:2011'><locality type='clause'>
163
- <referenceFrom>3.1</referenceFrom>
164
- </locality>ISO 7301:2011, Clause 3.1</origin>
165
- </termsource>
166
- </term>
167
- </terms>
168
- </sections>
169
- </iso-standard>
170
- PRESXML
171
-
172
- html = <<~"OUTPUT"
173
- #{HTML_HDR}
174
- <p class="zzSTDTitle1"/>
175
- <div id="_terms_and_definitions">
176
- <h1> 1. &#160; Terms and Definitions </h1>
177
- <p>For the purposes of this document,
178
- the following terms and definitions apply.</p>
179
- <p class="TermNum" id="paddy1">1.1.</p><p class="Terms" style="text-align:left;">paddy</p>
180
-
181
- <p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">&lt;rice&gt; rice retaining its husk after threshing</p>
182
- <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>
183
- <p id="_65c9a509-9a89-4b54-a890-274126aeb55c">Foreign seeds, husks, bran, sand, dust.</p>
184
- <ul>
185
- <li>A</li>
186
- </ul>
187
- </div>
188
- <div id="_bd57bbf1-f948-4bae-b0ce-73c00431f894" class="example"><p class="example-title">EXAMPLE 2</p>
189
- <ul>
190
- <li>A</li>
191
- </ul>
192
- </div>
193
-
194
- <p>[TERMREF]
195
- <a href="#ISO7301">ISO 7301:2011, Clause 3.1</a>
196
- [MODIFICATION] The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here
197
- [/TERMREF]</p>
198
- <p>[TERMREF] Termbase IEV, term ID xyz [/TERMREF]</p>
199
- <p>[TERMREF] Termbase IEV, term ID xyz [MODIFICATION]with adjustments [/TERMREF]</p>
200
- <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>
201
- <p class="AltTerms" style="text-align:left;">rough rice</p>
202
- <p class="DeprecatedTerms" style="text-align:left;">DEPRECATED: cargo rice</p>
203
- <p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p>
204
- <div id="_bd57bbf1-f948-4bae-b0ce-73c00431f893" class="example"><p class="example-title">EXAMPLE</p>
205
- <ul>
206
- <li>A</li>
207
- </ul>
208
- </div>
209
- <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>
210
- <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>
211
- <p>[TERMREF]
212
- <a href="#ISO7301">ISO 7301:2011, Clause 3.1</a>
213
- [/TERMREF]</p></div>
214
- </div>
215
- </body>
216
- </html>
217
- OUTPUT
218
-
219
- word = <<~"WORD"
220
- #{WORD_HDR}
221
- <p class="zzSTDTitle1"/>
222
- <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,
223
- the following terms and definitions apply.</p>
224
- <p class="TermNum" id="paddy1">1.1.</p><p class="Terms" style="text-align:left;">paddy</p>
225
-
226
- <p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">&lt;rice&gt; rice retaining its husk after threshing</p>
227
- <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>
228
- <p id="_65c9a509-9a89-4b54-a890-274126aeb55c">Foreign seeds, husks, bran, sand, dust.</p>
229
- <ul>
230
- <li>A</li>
231
- </ul>
232
- </div>
233
- <div id="_bd57bbf1-f948-4bae-b0ce-73c00431f894" class="example"><p class="example-title">EXAMPLE 2</p>
234
- <ul>
235
- <li>A</li>
236
- </ul>
237
- </div>
70
+ <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
71
+ <sections>
72
+ <terms id='_terms_and_definitions' obligation='normative'>
73
+ <title depth='1'>
74
+ 1.
75
+ <tab/>
76
+ Terms and Definitions
77
+ </title>
78
+ <p>For the purposes of this document, the following terms and definitions apply.</p>
79
+ <term id='paddy1'><name>1.1.</name>
80
+ <preferred>paddy</preferred>
81
+ <domain>rice</domain>
82
+ <definition>
83
+ <p id='_eb29b35e-123e-4d1c-b50b-2714d41e747f'>rice retaining its husk after threshing</p>
84
+ </definition>
85
+ <termexample id='_bd57bbf1-f948-4bae-b0ce-73c00431f892' keep-with-next='true' keep-lines-together='true'>
86
+ <name>EXAMPLE 1</name>
87
+ <p id='_65c9a509-9a89-4b54-a890-274126aeb55c'>Foreign seeds, husks, bran, sand, dust.</p>
88
+ <ul>
89
+ <li>A</li>
90
+ </ul>
91
+ </termexample>
92
+ <termexample id='_bd57bbf1-f948-4bae-b0ce-73c00431f894'>
93
+ <name>EXAMPLE 2</name>
94
+ <ul>
95
+ <li>A</li>
96
+ </ul>
97
+ </termexample>
98
+ <termsource status='modified'>
99
+ <origin bibitemid='ISO7301' type='inline' citeas='ISO 7301:2011'><locality type='clause'>
100
+ <referenceFrom>3.1</referenceFrom>
101
+ </locality>ISO 7301:2011, Clause 3.1</origin>
102
+ <modification>
103
+ <p id='_e73a417d-ad39-417d-a4c8-20e4e2529489'>
104
+ The term "cargo rice" is shown as deprecated, and Note 1 to entry
105
+ is not included here
106
+ </p>
107
+ </modification>
108
+ </termsource>
109
+ <termsource status='identical'>
110
+ <origin citeas=''>
111
+ <termref base='IEV' target='xyz'>t1</termref>
112
+ </origin>
113
+ </termsource>
114
+ <termsource status='modified'>
115
+ <origin citeas=''>
116
+ <termref base='IEV' target='xyz'/>
117
+ </origin>
118
+ <modification>
119
+ <p id='_'>with adjustments</p>
120
+ </modification>
121
+ </termsource>
122
+ </term>
123
+ <term id='paddy'><name>1.2.</name>
124
+ <preferred>paddy</preferred>
125
+ <admitted>paddy rice</admitted>
126
+ <admitted>rough rice</admitted>
127
+ <deprecates>cargo rice</deprecates>
128
+ <definition>
129
+ <p id='_eb29b35e-123e-4d1c-b50b-2714d41e747f'>rice retaining its husk after threshing</p>
130
+ </definition>
131
+ <termexample id='_bd57bbf1-f948-4bae-b0ce-73c00431f893'>
132
+ <name>EXAMPLE</name>
133
+ <ul>
134
+ <li>A</li>
135
+ </ul>
136
+ </termexample>
137
+ <termnote id='_671a1994-4783-40d0-bc81-987d06ffb74e' keep-with-next='true' keep-lines-together='true'>
138
+ <name>Note 1 to entry</name>
139
+ <p id='_19830f33-e46c-42cc-94ca-a5ef101132d5'>
140
+ The starch of waxy rice consists almost entirely of amylopectin. The
141
+ kernels have a tendency to stick together after cooking.
142
+ </p>
143
+ </termnote>
144
+ <termnote id='_671a1994-4783-40d0-bc81-987d06ffb74f'>
145
+ <name>Note 2 to entry</name>
146
+ <ul>
147
+ <li>A</li>
148
+ </ul>
149
+ <p id='_19830f33-e46c-42cc-94ca-a5ef101132d5'>
150
+ The starch of waxy rice consists almost entirely of amylopectin. The
151
+ kernels have a tendency to stick together after cooking.
152
+ </p>
153
+ </termnote>
154
+ <termsource status='identical'>
155
+ <origin bibitemid='ISO7301' type='inline' droploc='true' citeas='ISO 7301:2011'><locality type='clause'>
156
+ <referenceFrom>3.1</referenceFrom>
157
+ </locality>ISO 7301:2011, 3.1</origin>
158
+ <origin bibitemid='ISO7301' type='inline' case='lowercase' citeas='ISO 7301:2011'><locality type='clause'>
159
+ <referenceFrom>3.1</referenceFrom>
160
+ </locality>ISO 7301:2011, clause 3.1</origin>
161
+ </termsource>
162
+ </term>
163
+ </terms>
164
+ </sections>
165
+ </iso-standard>
166
+ PRESXML
238
167
 
239
- <p>[TERMREF]
240
- <a href="#ISO7301">ISO 7301:2011, Clause 3.1</a>
241
- [MODIFICATION] The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here
242
- [/TERMREF]</p>
243
- <p>[TERMREF] Termbase IEV, term ID xyz [/TERMREF]</p>
244
- <p>[TERMREF] Termbase IEV, term ID xyz [MODIFICATION]with adjustments [/TERMREF]</p>
245
- <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>
246
- <p class="AltTerms" style="text-align:left;">rough rice</p>
247
- <p class="DeprecatedTerms" style="text-align:left;">DEPRECATED: cargo rice</p>
248
- <p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p>
249
- <div id="_bd57bbf1-f948-4bae-b0ce-73c00431f893" class="example"><p class="example-title">EXAMPLE</p>
250
- <ul>
251
- <li>A</li>
252
- </ul>
253
- </div>
254
- <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>
255
- <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>
256
- <p>[TERMREF]
257
- <a href="#ISO7301">ISO 7301:2011, Clause 3.1</a>
258
- [/TERMREF]</p></div>
259
- </div>
260
- </body>
261
- </html>
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>
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>
209
+ </div>
210
+ </body>
211
+ </html>
212
+ OUTPUT
262
213
 
263
- WORD
264
- expect(xmlpp(IsoDoc::PresentationXMLConvert.new({}).convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
265
- expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", presxml, true))).to be_equivalent_to xmlpp(html)
266
- expect(xmlpp(IsoDoc::WordConvert.new({}).convert("test", presxml, true))).to be_equivalent_to xmlpp(word)
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>
256
+ WORD
257
+ expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
258
+ .convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
259
+ expect(xmlpp(IsoDoc::HtmlConvert.new({})
260
+ .convert("test", presxml, true))).to be_equivalent_to xmlpp(html)
261
+ expect(xmlpp(IsoDoc::WordConvert.new({})
262
+ .convert("test", presxml, true))).to be_equivalent_to xmlpp(word)
267
263
  end
268
264
  end