isodoc 1.5.5 → 1.6.4

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 (79) 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 +3 -7
  5. data/Gemfile +2 -2
  6. data/Rakefile +2 -2
  7. data/bin/rspec +1 -2
  8. data/isodoc.gemspec +11 -11
  9. data/lib/isodoc-yaml/i18n-ar.yaml +152 -0
  10. data/lib/isodoc-yaml/i18n-de.yaml +149 -0
  11. data/lib/isodoc-yaml/i18n-es.yaml +151 -0
  12. data/lib/isodoc-yaml/i18n-ru.yaml +154 -0
  13. data/lib/isodoc.rb +0 -2
  14. data/lib/isodoc/base_style/all.css +7 -0
  15. data/lib/isodoc/base_style/metanorma_word.css +7 -0
  16. data/lib/isodoc/base_style/metanorma_word.scss +8 -0
  17. data/lib/isodoc/base_style/reset.css +7 -0
  18. data/lib/isodoc/base_style/reset.scss +9 -0
  19. data/lib/isodoc/base_style/scripts.html +187 -0
  20. data/lib/isodoc/class_utils.rb +6 -5
  21. data/lib/isodoc/common.rb +2 -0
  22. data/lib/isodoc/convert.rb +30 -17
  23. data/lib/isodoc/css.rb +43 -34
  24. data/lib/isodoc/function/blocks.rb +21 -4
  25. data/lib/isodoc/function/blocks_example_note.rb +2 -2
  26. data/lib/isodoc/function/cleanup.rb +53 -45
  27. data/lib/isodoc/function/form.rb +51 -0
  28. data/lib/isodoc/function/inline.rb +37 -15
  29. data/lib/isodoc/function/references.rb +55 -42
  30. data/lib/isodoc/function/section.rb +29 -16
  31. data/lib/isodoc/function/table.rb +1 -0
  32. data/lib/isodoc/function/to_word_html.rb +33 -29
  33. data/lib/isodoc/function/utils.rb +180 -159
  34. data/lib/isodoc/gem_tasks.rb +30 -31
  35. data/lib/isodoc/headlesshtml_convert.rb +8 -7
  36. data/lib/isodoc/html_convert.rb +6 -4
  37. data/lib/isodoc/html_function/comments.rb +2 -0
  38. data/lib/isodoc/html_function/footnotes.rb +14 -7
  39. data/lib/isodoc/html_function/form.rb +62 -0
  40. data/lib/isodoc/html_function/html.rb +30 -26
  41. data/lib/isodoc/html_function/postprocess.rb +41 -82
  42. data/lib/isodoc/html_function/postprocess_footnotes.rb +59 -0
  43. data/lib/isodoc/i18n.rb +33 -31
  44. data/lib/isodoc/pdf_convert.rb +12 -16
  45. data/lib/isodoc/presentation_function/bibdata.rb +54 -30
  46. data/lib/isodoc/presentation_function/block.rb +17 -8
  47. data/lib/isodoc/presentation_function/inline.rb +84 -120
  48. data/lib/isodoc/presentation_function/math.rb +84 -0
  49. data/lib/isodoc/presentation_function/section.rb +20 -22
  50. data/lib/isodoc/presentation_xml_convert.rb +2 -1
  51. data/lib/isodoc/sassc_importer.rb +1 -1
  52. data/lib/isodoc/version.rb +1 -1
  53. data/lib/isodoc/word_function/body.rb +28 -24
  54. data/lib/isodoc/word_function/footnotes.rb +22 -15
  55. data/lib/isodoc/word_function/postprocess.rb +50 -36
  56. data/lib/isodoc/xref.rb +9 -10
  57. data/lib/isodoc/xref/xref_counter.rb +32 -17
  58. data/lib/isodoc/xref/xref_gen.rb +33 -21
  59. data/lib/isodoc/xref/xref_gen_seq.rb +60 -35
  60. data/lib/isodoc/xref/xref_sect_gen.rb +37 -35
  61. data/lib/isodoc/xslfo_convert.rb +36 -27
  62. data/spec/assets/scripts_override.html +3 -0
  63. data/spec/isodoc/blocks_spec.rb +2490 -2591
  64. data/spec/isodoc/cleanup_spec.rb +1107 -1109
  65. data/spec/isodoc/footnotes_spec.rb +1 -16
  66. data/spec/isodoc/form_spec.rb +156 -0
  67. data/spec/isodoc/i18n_spec.rb +984 -972
  68. data/spec/isodoc/inline_spec.rb +1129 -912
  69. data/spec/isodoc/lists_spec.rb +316 -315
  70. data/spec/isodoc/postproc_spec.rb +1751 -1540
  71. data/spec/isodoc/presentation_xml_spec.rb +403 -323
  72. data/spec/isodoc/ref_spec.rb +718 -723
  73. data/spec/isodoc/section_spec.rb +910 -902
  74. data/spec/isodoc/table_spec.rb +566 -556
  75. data/spec/isodoc/terms_spec.rb +251 -255
  76. data/spec/isodoc/xref_spec.rb +3041 -2992
  77. data/spec/isodoc/xslfo_convert_spec.rb +39 -0
  78. data/spec/spec_helper.rb +30 -29
  79. metadata +77 -65
@@ -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>
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
180
167
 
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>
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>
214
182
  </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>
238
-
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>
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