isodoc 1.8.2.1 → 1.8.3.2

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.
@@ -34,6 +34,9 @@ RSpec.describe IsoDoc do
34
34
  <origin citeas=''>
35
35
  <termref base='IEV' target='xyz'>t1</termref>
36
36
  </origin>
37
+ <modification>
38
+ <p id='_'/>
39
+ </modification>
37
40
  </termsource>
38
41
  <termsource status='modified'>
39
42
  <origin citeas=''>
@@ -74,183 +77,147 @@ RSpec.describe IsoDoc do
74
77
 
75
78
  presxml = <<~"PRESXML"
76
79
  <?xml version='1.0'?>
77
- <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
78
- <sections>
79
- <terms id='_terms_and_definitions' obligation='normative' displayorder="1">
80
- <title depth='1'>1.<tab/>Terms and Definitions</title>
81
- <p>For the purposes of this document, the following terms and definitions apply.</p>
82
- <term id='paddy1'><name>1.1.</name>
83
- <preferred><strong>paddy, &lt;in agriculture, dated&gt;</strong></preferred>
84
- <termsource status='modified'>
85
- <origin bibitemid='ISO7301' type='inline' citeas='ISO 7301:2011'><locality type='clause'>
86
- <referenceFrom>3.1</referenceFrom>
87
- </locality>ISO 7301:2011, Clause 3.1</origin>
88
- <modification>
89
- <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>
90
- </modification>
91
- </termsource>
92
- <domain>rice</domain>
93
- <definition>
94
- <p id='_eb29b35e-123e-4d1c-b50b-2714d41e747f'>rice retaining its husk after threshing</p>
95
- </definition>
96
- <termexample id='_bd57bbf1-f948-4bae-b0ce-73c00431f892' keep-with-next='true' keep-lines-together='true'>
97
- <name>EXAMPLE 1</name>
98
- <p id='_65c9a509-9a89-4b54-a890-274126aeb55c'>Foreign seeds, husks, bran, sand, dust.</p>
99
- <ul>
100
- <li>A</li>
101
- </ul>
102
- </termexample>
103
- <termexample id='_bd57bbf1-f948-4bae-b0ce-73c00431f894'>
104
- <name>EXAMPLE 2</name>
105
- <ul>
106
- <li>A</li>
107
- </ul>
108
- </termexample>
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><strong>paddy</strong></preferred>
125
- <admitted>paddy rice, &lt;in agriculture&gt;</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'>The starch of waxy rice consists almost entirely of amylopectin. The
140
- kernels have a tendency to stick together after cooking.</p>
141
- </termnote>
142
- <termnote id='_671a1994-4783-40d0-bc81-987d06ffb74f'>
143
- <name>Note 2 to entry</name>
144
- <ul>
145
- <li>A</li>
146
- </ul>
147
- <p id='_19830f33-e46c-42cc-94ca-a5ef101132d5'>The starch of waxy rice consists almost entirely of amylopectin. The
148
- kernels have a tendency to stick together after cooking.</p>
149
- </termnote>
150
- <termsource status='identical'>
151
- <origin bibitemid='ISO7301' type='inline' droploc='true' citeas='ISO 7301:2011'><locality type='clause'>
152
- <referenceFrom>3.1</referenceFrom>
153
- </locality>ISO 7301:2011, 3.1</origin>
154
- <origin bibitemid='ISO7301' type='inline' case='lowercase' citeas='ISO 7301:2011'><locality type='clause'>
155
- <referenceFrom>3.1</referenceFrom>
156
- </locality>ISO 7301:2011, clause 3.1</origin>
157
- </termsource>
158
- </term>
159
- </terms>
160
- </sections>
161
- </iso-standard>
80
+ <iso-standard xmlns="http://riboseinc.com/isoxml" type="presentation">
81
+ <sections>
82
+ <terms id="_terms_and_definitions" obligation="normative" displayorder="1"><title depth="1">1.<tab/>Terms and Definitions</title>
83
+ <p>For the purposes of this document, the following terms and definitions apply.</p>
84
+ <term id="paddy1"><name>1.1.</name><preferred><strong>paddy</strong>, &#x3c;in agriculture, dated&#x3e;</preferred><termsource status="modified">[SOURCE: <origin bibitemid="ISO7301" type="inline" citeas="ISO 7301:2011"><locality type="clause">
85
+ <referenceFrom>3.1</referenceFrom>
86
+ </locality>ISO 7301:2011, Clause 3.1</origin>, modified
87
+ &#x2013;
88
+ The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here]</termsource>
89
+ <domain>rice</domain>
90
+ <definition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p></definition>
91
+ <termexample id="_bd57bbf1-f948-4bae-b0ce-73c00431f892" keep-with-next="true" keep-lines-together="true"><name>EXAMPLE 1</name>
92
+ <p id="_65c9a509-9a89-4b54-a890-274126aeb55c">Foreign seeds, husks, bran, sand, dust.</p>
93
+ <ul>
94
+ <li>A</li>
95
+ </ul>
96
+ </termexample>
97
+ <termexample id="_bd57bbf1-f948-4bae-b0ce-73c00431f894"><name>EXAMPLE 2</name>
98
+ <ul>
99
+ <li>A</li>
100
+ </ul>
101
+ </termexample>
102
+ <termsource status="identical">[SOURCE: <origin citeas="">
103
+ <termref base="IEV" target="xyz">t1</termref>
104
+ </origin>, modified ;
105
+ <origin citeas="">
106
+ <termref base="IEV" target="xyz"/>
107
+ </origin>, modified
108
+ &#x2013;
109
+ with adjustments]</termsource>
110
+ </term>
111
+ <term id="paddy"><name>1.2.</name><preferred><strong>paddy</strong></preferred>
112
+ <admitted>paddy rice, &#x3c;in agriculture&#x3e;</admitted>
113
+ <admitted>rough rice</admitted>
114
+ <deprecates>cargo rice</deprecates>
115
+ <definition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p></definition>
116
+ <termexample id="_bd57bbf1-f948-4bae-b0ce-73c00431f893"><name>EXAMPLE</name>
117
+ <ul>
118
+ <li>A</li>
119
+ </ul>
120
+ </termexample>
121
+ <termnote id="_671a1994-4783-40d0-bc81-987d06ffb74e" keep-with-next="true" keep-lines-together="true"><name>Note 1 to entry</name>
122
+ <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>
123
+ </termnote>
124
+ <termnote id="_671a1994-4783-40d0-bc81-987d06ffb74f"><name>Note 2 to entry</name>
125
+ <ul><li>A</li></ul>
126
+ <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>
127
+ </termnote>
128
+ <termsource status="identical">[SOURCE: <origin bibitemid="ISO7301" type="inline" droploc="true" citeas="ISO 7301:2011"><locality type="clause">
129
+ <referenceFrom>3.1</referenceFrom>
130
+ </locality>ISO 7301:2011, 3.1</origin>
131
+ <origin bibitemid="ISO7301" type="inline" case="lowercase" citeas="ISO 7301:2011"><locality type="clause">
132
+ <referenceFrom>3.1</referenceFrom>
133
+ </locality>ISO 7301:2011, clause 3.1</origin>]</termsource></term>
134
+ </terms>
135
+ </sections>
136
+ </iso-standard>
162
137
  PRESXML
163
138
 
164
139
  html = <<~"OUTPUT"
165
140
  #{HTML_HDR}
166
- <p class="zzSTDTitle1"/>
167
- <div id="_terms_and_definitions">
168
- <h1>1.&#160; Terms and Definitions</h1>
169
- <p>For the purposes of this document,
170
- the following terms and definitions apply.</p>
171
- <p class="TermNum" id="paddy1">1.1.</p><p class="Terms" style="text-align:left;"><b>paddy, &lt;in agriculture, dated&gt;</b></p>
172
- <p>[TERMREF]
173
- <a href="#ISO7301">ISO 7301:2011, Clause 3.1</a>
174
- [MODIFICATION]The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here
175
- [/TERMREF]</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] t1 [/TERMREF]</p>
189
- <p>[TERMREF] Termbase IEV, term ID xyz [MODIFICATION]with adjustments [/TERMREF]</p>
190
- <p class="TermNum" id="paddy">1.2.</p>
191
- <p class="Terms" style="text-align:left;"><b>paddy</b></p><p class="AltTerms" style="text-align:left;">paddy rice, &lt;in agriculture&gt;</p>
192
- <p class="AltTerms" style="text-align:left;">rough rice</p>
193
- <p class="DeprecatedTerms" style="text-align:left;">DEPRECATED: cargo rice</p>
194
- <p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p>
195
- <div id="_bd57bbf1-f948-4bae-b0ce-73c00431f893" class="example"><p class="example-title">EXAMPLE</p>
196
- <ul>
197
- <li>A</li>
198
- </ul>
199
- </div>
200
- <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>
201
- <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>
202
- <p>[TERMREF]
203
- <a href='#ISO7301'>ISO 7301:2011, 3.1</a>
204
- <a href='#ISO7301'>ISO 7301:2011, clause 3.1</a>
205
- [/TERMREF]</p></div>
206
- </div>
207
- </body>
208
- </html>
141
+ <p class="zzSTDTitle1"/>
142
+ <div id="_terms_and_definitions"><h1>1.&#160; Terms and Definitions</h1><p>For the purposes of this document, the following terms and definitions apply.</p><p class="TermNum" id="paddy1">1.1.</p><p class="Terms" style="text-align:left;"><b>paddy</b>, &lt;in agriculture, dated&gt;</p><p>[SOURCE: <a href="#ISO7301">ISO 7301:2011, Clause 3.1</a>, modified
143
+ &#8211;
144
+ The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here]</p>
145
+
146
+ <p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">&lt;rice&gt; rice retaining its husk after threshing</p>
147
+ <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>
148
+ <p id="_65c9a509-9a89-4b54-a890-274126aeb55c">Foreign seeds, husks, bran, sand, dust.</p>
149
+ <ul>
150
+ <li>A</li>
151
+ </ul>
152
+ </div>
153
+ <div id="_bd57bbf1-f948-4bae-b0ce-73c00431f894" class="example"><p class="example-title">EXAMPLE 2</p>
154
+ <ul>
155
+ <li>A</li>
156
+ </ul>
157
+ </div>
158
+ <p>[SOURCE: t1, modified ;
159
+ Termbase IEV, term ID xyz, modified
160
+ &#8211;
161
+ with adjustments]</p>
162
+ <p class="TermNum" id="paddy">1.2.</p><p class="Terms" style="text-align:left;"><b>paddy</b></p>
163
+ <p class="AltTerms" style="text-align:left;">paddy rice, &lt;in agriculture&gt;</p>
164
+ <p class="AltTerms" style="text-align:left;">rough rice</p>
165
+ <p class="DeprecatedTerms" style="text-align:left;">DEPRECATED: cargo rice</p>
166
+ <p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p>
167
+ <div id="_bd57bbf1-f948-4bae-b0ce-73c00431f893" class="example"><p class="example-title">EXAMPLE</p>
168
+ <ul>
169
+ <li>A</li>
170
+ </ul>
171
+ </div>
172
+ <div id="_671a1994-4783-40d0-bc81-987d06ffb74e" class="Note" 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>
173
+ <div id="_671a1994-4783-40d0-bc81-987d06ffb74f" class="Note"><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>
174
+ <p>[SOURCE: <a href="#ISO7301">ISO 7301:2011, 3.1</a>
175
+ <a href="#ISO7301">ISO 7301:2011, clause 3.1</a>]</p></div>
176
+ </div>
177
+ </body>
178
+ </html>
209
179
  OUTPUT
210
180
 
211
181
  word = <<~"WORD"
212
182
  #{WORD_HDR}
213
- <p class="zzSTDTitle1"/>
214
- <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,
215
- the following terms and definitions apply.</p>
216
- <p class="TermNum" id="paddy1">1.1.</p><p class="Terms" style="text-align:left;"><b>paddy, &lt;in agriculture, dated&gt;</b></p>
217
- <p>[TERMREF]
218
- <a href="#ISO7301">ISO 7301:2011, Clause 3.1</a>
219
- [MODIFICATION]The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here
220
- [/TERMREF]</p>
221
- <p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">&lt;rice&gt; rice retaining its husk after threshing</p>
222
- <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>
223
- <p id="_65c9a509-9a89-4b54-a890-274126aeb55c">Foreign seeds, husks, bran, sand, dust.</p>
224
- <ul>
225
- <li>A</li>
226
- </ul>
227
- </div>
228
- <div id="_bd57bbf1-f948-4bae-b0ce-73c00431f894" class="example"><p class="example-title">EXAMPLE 2</p>
229
- <ul>
230
- <li>A</li>
231
- </ul>
232
- </div>
233
- <p>[TERMREF] t1 [/TERMREF]</p>
234
- <p>[TERMREF] Termbase IEV, term ID xyz [MODIFICATION]with adjustments [/TERMREF]</p>
235
- <p class="TermNum" id="paddy">1.2.</p><p class="Terms" style="text-align:left;"><b>paddy</b></p>
236
- <p class="AltTerms" style="text-align:left;">paddy rice, &lt;in agriculture&gt;</p>
237
- <p class="AltTerms" style="text-align:left;">rough rice</p>
238
- <p class="DeprecatedTerms" style="text-align:left;">DEPRECATED: cargo rice</p>
239
- <p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p>
240
- <div id="_bd57bbf1-f948-4bae-b0ce-73c00431f893" class="example"><p class="example-title">EXAMPLE</p>
241
- <ul>
242
- <li>A</li>
243
- </ul>
244
- </div>
245
- <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>
246
- <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>
247
- <p>[TERMREF]
248
- <a href='#ISO7301'>ISO 7301:2011, 3.1</a>
249
- <a href='#ISO7301'>ISO 7301:2011, clause 3.1</a>
250
- [/TERMREF]</p></div>
251
- </div>
252
- </body>
253
- </html>
183
+ <p class="zzSTDTitle1"/>
184
+ <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, the following terms and definitions apply.</p><p class="TermNum" id="paddy1">1.1.</p><p class="Terms" style="text-align:left;"><b>paddy</b>, &lt;in agriculture, dated&gt;</p><p>[SOURCE: <a href="#ISO7301">ISO 7301:2011, Clause 3.1</a>, modified
185
+ &#8211;
186
+ The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here]</p>
187
+
188
+ <p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">&lt;rice&gt; rice retaining its husk after threshing</p>
189
+ <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>
190
+ <p id="_65c9a509-9a89-4b54-a890-274126aeb55c">Foreign seeds, husks, bran, sand, dust.</p>
191
+ <ul>
192
+ <li>A</li>
193
+ </ul>
194
+ </div>
195
+ <div id="_bd57bbf1-f948-4bae-b0ce-73c00431f894" class="example"><p class="example-title">EXAMPLE 2</p>
196
+ <ul>
197
+ <li>A</li>
198
+ </ul>
199
+ </div>
200
+ <p>[SOURCE: t1, modified ;
201
+ Termbase IEV, term ID xyz, modified
202
+ &#8211;
203
+ with adjustments]</p>
204
+ <p class="TermNum" id="paddy">1.2.</p><p class="Terms" style="text-align:left;"><b>paddy</b></p>
205
+ <p class="AltTerms" style="text-align:left;">paddy rice, &lt;in agriculture&gt;</p>
206
+ <p class="AltTerms" style="text-align:left;">rough rice</p>
207
+ <p class="DeprecatedTerms" style="text-align:left;">DEPRECATED: cargo rice</p>
208
+ <p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p>
209
+ <div id="_bd57bbf1-f948-4bae-b0ce-73c00431f893" class="example"><p class="example-title">EXAMPLE</p>
210
+ <ul>
211
+ <li>A</li>
212
+ </ul>
213
+ </div>
214
+ <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>
215
+ <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>
216
+ <p>[SOURCE: <a href="#ISO7301">ISO 7301:2011, 3.1</a>
217
+ <a href="#ISO7301">ISO 7301:2011, clause 3.1</a>]</p></div>
218
+ </div>
219
+ </body>
220
+ </html>
254
221
  WORD
255
222
  expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
256
223
  .convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
@@ -325,19 +292,15 @@ RSpec.describe IsoDoc do
325
292
  </li>
326
293
  <li>
327
294
  <p id='_eb29b35e-123e-4d1c-b50b-2714d41e747e'>rice retaining its husk after threshing, mark 2</p>
328
- <termsource status='modified'>
295
+ <termsource status='modified'>[SOURCE:
329
296
  <origin bibitemid='ISO7301' type='inline' citeas='ISO 7301:2011'>
330
297
  <locality type='clause'>
331
298
  <referenceFrom>3.1</referenceFrom>
332
299
  </locality>
333
300
  ISO 7301:2011, Clause 3.1
334
- </origin>
335
- <modification>
336
- <p id='_e73a417d-ad39-417d-a4c8-20e4e2529489'>
301
+ </origin>, modified &#x2013;
337
302
  The term "cargo rice" is shown as deprecated, and Note 1 to
338
- entry is not included here
339
- </p>
340
- </modification>
303
+ entry is not included here]
341
304
  </termsource>
342
305
  </li>
343
306
  </ol>
@@ -355,18 +318,13 @@ RSpec.describe IsoDoc do
355
318
  <li>A</li>
356
319
  </ul>
357
320
  </termexample>
358
- <termsource status='identical'>
321
+ <termsource status='identical'>[SOURCE:
359
322
  <origin citeas=''>
360
323
  <termref base='IEV' target='xyz'>t1</termref>
361
- </origin>
362
- </termsource>
363
- <termsource status='modified'>
324
+ </origin>;
364
325
  <origin citeas=''>
365
326
  <termref base='IEV' target='xyz'/>
366
- </origin>
367
- <modification>
368
- <p id='_'>with adjustments</p>
369
- </modification>
327
+ </origin>, modified &#x2013; with adjustments]
370
328
  </termsource>
371
329
  </term>
372
330
  </terms>
@@ -556,7 +514,7 @@ RSpec.describe IsoDoc do
556
514
  <preferred><strong/></preferred>
557
515
  <preferred isInternational='true'><figure id='_'>
558
516
  <name>Figure 1</name>
559
- <pre id='_'>&lt;LITERAL&gt; FIGURATIVE</pre>
517
+ <pre id='_'>&#x3c;LITERAL&#x3e; FIGURATIVE</pre>
560
518
  </figure>
561
519
  </preferred>
562
520
  <domain>rice</domain>
@@ -676,7 +634,7 @@ RSpec.describe IsoDoc do
676
634
  <preferred><strong>Term</strong></preferred>
677
635
  <definition>
678
636
  <p id='C'>Definition</p>
679
- <termsource status='identical' type='authoritative'>
637
+ <termsource status='identical' type='authoritative'>[SOURCE:
680
638
  <origin bibitemid='ISO2191' type='inline' citeas=''>
681
639
  <localityStack>
682
640
  <locality type='section'>
@@ -684,7 +642,7 @@ RSpec.describe IsoDoc do
684
642
  </locality>
685
643
  </localityStack>
686
644
  , Section 1
687
- </origin>
645
+ </origin>]
688
646
  </termsource>
689
647
  <table id='D'>
690
648
  <name>Table 1</name>
@@ -702,7 +660,7 @@ RSpec.describe IsoDoc do
702
660
  </tbody>
703
661
  </table>
704
662
  </definition>
705
- <termsource status='identical' type='authoritative'>
663
+ <termsource status='identical' type='authoritative'>[SOURCE:
706
664
  <origin bibitemid='ISO2191' type='inline' citeas=''>
707
665
  <localityStack>
708
666
  <locality type='section'>
@@ -710,7 +668,7 @@ RSpec.describe IsoDoc do
710
668
  </locality>
711
669
  </localityStack>
712
670
  , Section 2
713
- </origin>
671
+ </origin>]
714
672
  </termsource>
715
673
  </term>
716
674
  <term id='term-term-2'>
@@ -732,7 +690,7 @@ RSpec.describe IsoDoc do
732
690
  <!-- x = y -->
733
691
  </stem>
734
692
  </formula>
735
- <termsource status='identical' type='authoritative'>
693
+ <termsource status='identical' type='authoritative'>[SOURCE:
736
694
  <origin bibitemid='ISO2191' type='inline' citeas=''>
737
695
  <localityStack>
738
696
  <locality type='section'>
@@ -740,7 +698,7 @@ RSpec.describe IsoDoc do
740
698
  </locality>
741
699
  </localityStack>
742
700
  , Section 3
743
- </origin>
701
+ </origin>]
744
702
  </termsource>
745
703
  </definition>
746
704
  </term>
@@ -2800,6 +2800,77 @@ RSpec.describe IsoDoc do
2800
2800
  .to be_equivalent_to xmlpp(output)
2801
2801
  end
2802
2802
 
2803
+ it "cross-references definition list terms that are stem expressions" do
2804
+ input = <<~INPUT
2805
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
2806
+ <preface>
2807
+ <foreword>
2808
+ <p>
2809
+ <xref target="N1"/>
2810
+ </p>
2811
+ </foreword>
2812
+ <introduction id="intro">
2813
+ <dl id="N01">
2814
+ <dt id="N1"><stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mrow><mover accent="true"><mrow><mi>e</mi></mrow><mo>^</mo></mover></mrow><mrow><mi>r</mi></mrow></msub></math></stem>
2815
+ <index><primary>
2816
+ <stem type="MathML">
2817
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
2818
+ <msub>
2819
+ <mrow>
2820
+ <mover accent="true">
2821
+ <mrow>
2822
+ <mi>e</mi>
2823
+ </mrow>
2824
+ <mo>^</mo>
2825
+ </mover>
2826
+ </mrow>
2827
+ <mrow>
2828
+ <mi>r</mi>
2829
+ </mrow>
2830
+ </msub>
2831
+ </math>
2832
+ </stem>
2833
+ </primary></index></dt><dd>
2834
+ <p id="_543e0447-dfc6-477e-00cb-1738d6853190"><stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>r</mi></math></stem>-direction</p>
2835
+ </dd>
2836
+ </dl>
2837
+ </clause>
2838
+ </annex>
2839
+ </iso-standard>
2840
+ INPUT
2841
+ output = <<~OUTPUT
2842
+ <foreword displayorder='1'>
2843
+ <p>
2844
+ <xref target='N1'>
2845
+ Introduction, Definition List:
2846
+ <stem type='MathML'>
2847
+ <math xmlns='http://www.w3.org/1998/Math/MathML'>
2848
+ <msub>
2849
+ <mrow>
2850
+ <mover accent='true'>
2851
+ <mrow>
2852
+ <mi>e</mi>
2853
+ </mrow>
2854
+ <mo>^</mo>
2855
+ </mover>
2856
+ </mrow>
2857
+ <mrow>
2858
+ <mi>r</mi>
2859
+ </mrow>
2860
+ </msub>
2861
+ </math>
2862
+ <!-- (hat e)_((r)) -->
2863
+ </stem>
2864
+ </xref>
2865
+ </p>
2866
+ </foreword>
2867
+ OUTPUT
2868
+ expect(xmlpp(Nokogiri::XML(IsoDoc::PresentationXMLConvert.new({})
2869
+ .convert("test", input, true))
2870
+ .at("//xmlns:foreword").to_xml))
2871
+ .to be_equivalent_to xmlpp(output)
2872
+ end
2873
+
2803
2874
  it "cross-references bookmarks" do
2804
2875
  input = <<~INPUT
2805
2876
  <iso-standard xmlns="http://riboseinc.com/isoxml">
@@ -61,4 +61,39 @@ RSpec.describe IsoDoc do
61
61
  expect(convert.pdf_options(nil))
62
62
  .to eq({ "--param baseassetpath=" => "ABC" })
63
63
  end
64
+
65
+ it "test pdf encryption options" do
66
+ convert = IsoDoc::XslfoPdfConvert.new(
67
+ {
68
+ pdfencryptionlength: "a",
69
+ pdfownerpassword: "b",
70
+ pdfuserpassword: "c",
71
+ pdfallowprint: "d",
72
+ pdfallowcopycontent: "e",
73
+ pdfalloweditcontent: "f",
74
+ pdfalloweditannotations: "g",
75
+ pdfallowfillinforms: "h",
76
+ pdfallowaccesscontent: "i",
77
+ pdfallowassembledocument: "j",
78
+ pdfallowprinthq: "k",
79
+ pdfencryptmetadata: "l",
80
+ },
81
+ )
82
+
83
+ expect(convert.pdf_options(nil))
84
+ .to eq({
85
+ "--allow-access-content" => "i",
86
+ "--allow-assemble-document" => "j",
87
+ "--allow-copy-content" => "e",
88
+ "--allow-edit-annotations" => "g",
89
+ "--allow-edit-content" => "f",
90
+ "--allow-fill-in-forms" => "h",
91
+ "--allow-print" => "d",
92
+ "--allow-print-hq" => "k",
93
+ "--encrypt-metadata" => "l",
94
+ "--encryption-length" => "a",
95
+ "--owner-password" => "b",
96
+ "--user-password" => "c",
97
+ })
98
+ end
64
99
  end
data/spec/spec_helper.rb CHANGED
@@ -31,7 +31,7 @@ end
31
31
 
32
32
  def metadata(hash)
33
33
  Hash[hash.sort].delete_if do |_k, v|
34
- v.nil? || v.respond_to?(:empty?) && v.empty?
34
+ v.nil? || (v.respond_to?(:empty?) && v.empty?)
35
35
  end
36
36
  end
37
37
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: isodoc
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.2.1
4
+ version: 1.8.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-11-29 00:00:00.000000000 Z
11
+ date: 2021-12-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: asciimath
@@ -517,7 +517,7 @@ homepage: https://github.com/metanorma/isodoc
517
517
  licenses:
518
518
  - BSD-2-Clause
519
519
  metadata: {}
520
- post_install_message:
520
+ post_install_message:
521
521
  rdoc_options: []
522
522
  require_paths:
523
523
  - lib
@@ -532,8 +532,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
532
532
  - !ruby/object:Gem::Version
533
533
  version: '0'
534
534
  requirements: []
535
- rubygems_version: 3.2.22
536
- signing_key:
535
+ rubygems_version: 3.1.6
536
+ signing_key:
537
537
  specification_version: 4
538
538
  summary: Convert documents in IsoDoc into Word and HTML in AsciiDoc.
539
539
  test_files: []