metanorma-iso 1.9.6 → 1.10.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ubuntu.yml +41 -0
  3. data/Gemfile +3 -4
  4. data/Makefile +44 -0
  5. data/Rakefile +1 -1
  6. data/bin/rspec +1 -2
  7. data/lib/asciidoctor/iso/cleanup.rb +7 -6
  8. data/lib/asciidoctor/iso/front.rb +2 -2
  9. data/lib/asciidoctor/iso/isodoc.rng +254 -27
  10. data/lib/asciidoctor/iso/section.rb +1 -1
  11. data/lib/asciidoctor/iso/validate.rb +7 -7
  12. data/lib/asciidoctor/iso/validate_section.rb +1 -1
  13. data/lib/isodoc/iso/html/isodoc.css +0 -1
  14. data/lib/isodoc/iso/html/isodoc.scss +0 -1
  15. data/lib/isodoc/iso/html/style-human.css +0 -1
  16. data/lib/isodoc/iso/html/style-human.scss +0 -1
  17. data/lib/isodoc/iso/html/style-iso.css +0 -1
  18. data/lib/isodoc/iso/html/style-iso.scss +0 -1
  19. data/lib/isodoc/iso/i18n.rb +10 -9
  20. data/lib/isodoc/iso/iso.amendment.xsl +57 -17
  21. data/lib/isodoc/iso/iso.international-standard.xsl +57 -17
  22. data/lib/isodoc/iso/isosts_convert.rb +6 -2
  23. data/lib/isodoc/iso/presentation_xml_convert.rb +19 -9
  24. data/lib/isodoc/iso/sections.rb +2 -0
  25. data/lib/isodoc/iso/sts_convert.rb +5 -2
  26. data/lib/isodoc/iso/word_cleanup.rb +94 -0
  27. data/lib/isodoc/iso/word_convert.rb +12 -89
  28. data/lib/metanorma/iso/processor.rb +2 -2
  29. data/lib/metanorma/iso/version.rb +1 -1
  30. data/metanorma-iso.gemspec +4 -5
  31. data/spec/asciidoctor/base_spec.rb +543 -209
  32. data/spec/asciidoctor/blocks_spec.rb +22 -47
  33. data/spec/asciidoctor/cleanup_spec.rb +37 -20
  34. data/spec/asciidoctor/inline_spec.rb +10 -2
  35. data/spec/asciidoctor/refs_spec.rb +174 -88
  36. data/spec/asciidoctor/section_spec.rb +3 -3
  37. data/spec/isodoc/i18n_spec.rb +36 -22
  38. data/spec/isodoc/inline_spec.rb +6 -6
  39. data/spec/isodoc/section_spec.rb +4 -4
  40. data/spec/isodoc/table_spec.rb +6 -8
  41. data/spec/isodoc/terms_spec.rb +25 -25
  42. data/spec/isodoc/xref_spec.rb +1397 -1376
  43. data/spec/metanorma/processor_spec.rb +114 -15
  44. data/spec/spec_helper.rb +2 -1
  45. data/spec/vcr_cassettes/docrels.yml +427 -37
  46. data/spec/vcr_cassettes/sortrefs.yml +599 -0
  47. metadata +13 -24
@@ -5,7 +5,7 @@ require "relaton_ietf"
5
5
  RSpec.describe Asciidoctor::ISO do
6
6
  it "processes draft ISO reference" do
7
7
  mock_fdis
8
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
8
+ input = <<~INPUT
9
9
  #{ISOBIB_BLANK_HDR}
10
10
  == Clause
11
11
  <<iso123>>
@@ -20,6 +20,7 @@ RSpec.describe Asciidoctor::ISO do
20
20
  * [[[iso123,ISO 123:--]]] footnote:[The standard is in press] _Standard_
21
21
  * [[[fdis,ISO/FDIS 17664-1]]] Title
22
22
  INPUT
23
+ output = <<~OUTPUT
23
24
  #{BLANK_HDR}
24
25
  <sections>
25
26
  <clause id="_" inline-header="false" obligation="normative">
@@ -169,10 +170,12 @@ RSpec.describe Asciidoctor::ISO do
169
170
  </bibliography>
170
171
  </iso-standard>
171
172
  OUTPUT
173
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
174
+ .to be_equivalent_to xmlpp(output)
172
175
  end
173
176
 
174
177
  it "processes all-parts ISO reference" do
175
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
178
+ input = <<~INPUT
176
179
  #{ASCIIDOC_BLANK_HDR}
177
180
 
178
181
  == Clause
@@ -184,6 +187,7 @@ RSpec.describe Asciidoctor::ISO do
184
187
 
185
188
  * [[[iso123,ISO 123:1066 (all parts)]]] _Standard_
186
189
  INPUT
190
+ output = <<~OUTPUT
187
191
  #{BLANK_HDR}
188
192
  <sections>
189
193
  <clause id="_" inline-header="false" obligation="normative">
@@ -219,16 +223,19 @@ RSpec.describe Asciidoctor::ISO do
219
223
  </bibliography>
220
224
  </iso-standard>
221
225
  OUTPUT
226
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
227
+ .to be_equivalent_to xmlpp(output)
222
228
  end
223
229
 
224
230
  it "processes non-ISO reference in Normative References" do
225
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
231
+ input = <<~INPUT
226
232
  #{ASCIIDOC_BLANK_HDR}
227
233
  [bibliography]
228
234
  == Normative References
229
235
 
230
236
  * [[[iso123,XYZ 123:1066 (all parts)]]] _Standard_
231
237
  INPUT
238
+ output = <<~OUTPUT
232
239
  #{BLANK_HDR}
233
240
  <sections>
234
241
 
@@ -248,16 +255,19 @@ RSpec.describe Asciidoctor::ISO do
248
255
  </bibliography>
249
256
  </iso-standard>
250
257
  OUTPUT
258
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
259
+ .to be_equivalent_to xmlpp(output)
251
260
  end
252
261
 
253
262
  it "processes non-ISO reference in Bibliography" do
254
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
263
+ input = <<~INPUT
255
264
  #{ASCIIDOC_BLANK_HDR}
256
265
  [bibliography]
257
266
  == Bibliography
258
267
 
259
268
  * [[[iso123,1]]] _Standard_
260
269
  INPUT
270
+ output = <<~OUTPUT
261
271
  #{BLANK_HDR}
262
272
  <sections>
263
273
 
@@ -275,101 +285,177 @@ RSpec.describe Asciidoctor::ISO do
275
285
  </bibliography>
276
286
  </iso-standard>
277
287
  OUTPUT
288
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
289
+ .to be_equivalent_to xmlpp(output)
290
+ end
291
+
292
+ it "sort ISO references in Bibliography" do
293
+ VCR.use_cassette "sortrefs" do
294
+ input = <<~INPUT
295
+ #{ASCIIDOC_BLANK_HDR}
296
+ [bibliography]
297
+ == Bibliography
298
+
299
+ * [[[iso1,ISO 8000-110]]]
300
+ * [[[iso2,ISO 8000-61]]]
301
+ * [[[iso3,ISO 8000-8]]]
302
+ * [[[iso4,ISO 9]]]
303
+ INPUT
304
+ output = <<~OUTPUT
305
+ #{BLANK_HDR}
306
+ <sections> </sections>
307
+ <bibliography>
308
+ <references id='_' normative='false' obligation='informative'>
309
+ <title>Bibliography</title>
310
+ <bibitem id='iso4' type='standard'>
311
+ <docidentifier>ISO 9</docidentifier>
312
+ <docnumber>9</docnumber>
313
+ <contributor>
314
+ <role type='publisher'/>
315
+ <organization>
316
+ <name>International Organization for Standardization</name>
317
+ <abbreviation>ISO</abbreviation>
318
+ </organization>
319
+ </contributor>
320
+ </bibitem>
321
+ <bibitem id='iso3' type='standard'>
322
+ <docidentifier>ISO 8000-8</docidentifier>
323
+ <docnumber>8000-8</docnumber>
324
+ <contributor>
325
+ <role type='publisher'/>
326
+ <organization>
327
+ <name>International Organization for Standardization</name>
328
+ <abbreviation>ISO</abbreviation>
329
+ </organization>
330
+ </contributor>
331
+ </bibitem>
332
+ <bibitem id='iso2' type='standard'>
333
+ <docidentifier>ISO 8000-61</docidentifier>
334
+ <docnumber>8000-61</docnumber>
335
+ <contributor>
336
+ <role type='publisher'/>
337
+ <organization>
338
+ <name>International Organization for Standardization</name>
339
+ <abbreviation>ISO</abbreviation>
340
+ </organization>
341
+ </contributor>
342
+ </bibitem>
343
+ <bibitem id='iso1' type='standard'>
344
+ <docidentifier>ISO 8000-110</docidentifier>
345
+ <docnumber>8000-110</docnumber>
346
+ <contributor>
347
+ <role type='publisher'/>
348
+ <organization>
349
+ <name>International Organization for Standardization</name>
350
+ <abbreviation>ISO</abbreviation>
351
+ </organization>
352
+ </contributor>
353
+ </bibitem>
354
+ </references>
355
+ </bibliography>
356
+ </iso-standard>
357
+ OUTPUT
358
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
359
+ .to be_equivalent_to xmlpp(output)
360
+ end
278
361
  end
279
362
 
280
363
  private
281
364
 
282
365
  def mock_fdis
283
366
  expect(RelatonIso::IsoBibliography).to receive(:get)
284
- .with("ISO/FDIS 17664-1", nil, lang: "en", title: "Title", usrlbl: nil) do
285
- RelatonIsoBib::XMLParser.from_xml(<<~"OUTPUT")
286
- <bibitem id="x" type="standard">
287
- <fetched>#{Date.today}</fetched>
288
- <title format="text/plain" language="fr" script="Latn" type="title-intro">Traitement de produits de soins de santé</title>
289
- <title format="text/plain" language="fr" script="Latn" type="title-main">Informations relatives au traitement des dispositifs médicaux à fournir par le fabricant du dispositif</title>
290
- <title format="text/plain" language="fr" script="Latn" type="title-part">Partie 1: Titre manque</title>
291
- <title format="text/plain" language="fr" script="Latn" type="main">Traitement de produits de soins de santé — Informations relatives au traitement des dispositifs médicaux à fournir par le fabricant du dispositif — Partie 1: Titre manque</title>
292
- <uri type="src">https://www.iso.org/standard/81720.html</uri>
293
- <uri type="rss">https://www.iso.org/contents/data/standard/08/17/81720.detail.rss</uri>
294
- <docidentifier type="ISO">ISO/FDIS 17664-1</docidentifier>
295
- <docidentifier type="URN">urn:iso:std:iso-fdis:17664:-1:stage-50.00:ed-1:fr</docidentifier>
296
- <docnumber>17664</docnumber>
297
- <contributor>
298
- <role type="publisher"/>
367
+ .with("ISO/FDIS 17664-1", nil, code: "ISO/FDIS 17664-1",
368
+ lang: "en", match: anything, ord: anything,
369
+ process: 1, year: nil,
370
+ title: "Title", usrlbl: nil) do
371
+ RelatonIsoBib::XMLParser.from_xml(<<~"OUTPUT")
372
+ <bibitem id="x" type="standard">
373
+ <fetched>#{Date.today}</fetched>
374
+ <title format="text/plain" language="fr" script="Latn" type="title-intro">Traitement de produits de soins de santé</title>
375
+ <title format="text/plain" language="fr" script="Latn" type="title-main">Informations relatives au traitement des dispositifs médicaux à fournir par le fabricant du dispositif</title>
376
+ <title format="text/plain" language="fr" script="Latn" type="title-part">Partie 1: Titre manque</title>
377
+ <title format="text/plain" language="fr" script="Latn" type="main">Traitement de produits de soins de santé — Informations relatives au traitement des dispositifs médicaux à fournir par le fabricant du dispositif — Partie 1: Titre manque</title>
378
+ <uri type="src">https://www.iso.org/standard/81720.html</uri>
379
+ <uri type="rss">https://www.iso.org/contents/data/standard/08/17/81720.detail.rss</uri>
380
+ <docidentifier type="ISO">ISO/FDIS 17664-1</docidentifier>
381
+ <docidentifier type="URN">urn:iso:std:iso-fdis:17664:-1:stage-50.00:ed-1:fr</docidentifier>
382
+ <docnumber>17664</docnumber>
383
+ <contributor>
384
+ <role type="publisher"/>
385
+ <organization>
386
+ <name>International Organization for Standardization</name>
387
+ <abbreviation>ISO</abbreviation>
388
+ <uri>www.iso.org</uri>
389
+ </organization>
390
+ </contributor>
391
+ <edition>1</edition>
392
+ <language>en</language>
393
+ <language>fr</language>
394
+ <script>Latn</script>
395
+ <status>
396
+ <stage>50</stage>
397
+ <substage>00</substage>
398
+ </status>
399
+ <copyright>
400
+ <from>unknown</from>
401
+ <owner>
299
402
  <organization>
300
- <name>International Organization for Standardization</name>
301
- <abbreviation>ISO</abbreviation>
302
- <uri>www.iso.org</uri>
403
+ <name>ISO/FDIS</name>
303
404
  </organization>
304
- </contributor>
305
- <edition>1</edition>
306
- <language>en</language>
307
- <language>fr</language>
308
- <script>Latn</script>
309
- <status>
310
- <stage>50</stage>
311
- <substage>00</substage>
312
- </status>
313
- <copyright>
314
- <from>unknown</from>
315
- <owner>
405
+ </owner>
406
+ </copyright>
407
+ <relation type="obsoletes">
408
+ <bibitem type="standard">
409
+ <formattedref format="text/plain">ISO 17664:2017</formattedref>
410
+ </bibitem>
411
+ </relation>
412
+ <relation type="instance">
413
+ <bibitem type="standard">
414
+ <fetched>2020-11-03</fetched>
415
+ <title format="text/plain" language="fr" script="Latn" type="title-intro">Traitement de produits de soins de santé</title>
416
+ <title format="text/plain" language="fr" script="Latn" type="title-main">Informations relatives au traitement des dispositifs médicaux à fournir par le fabricant du dispositif</title>
417
+ <title format="text/plain" language="fr" script="Latn" type="title-part">Partie 1: Titre manque</title>
418
+ <title format="text/plain" language="fr" script="Latn" type="main">Traitement de produits de soins de santé — Informations relatives au traitement des dispositifs médicaux à fournir par le fabricant du dispositif — Partie 1: Titre manque</title>
419
+ <uri type="src">https://www.iso.org/standard/81720.html</uri>
420
+ <uri type="rss">https://www.iso.org/contents/data/standard/08/17/81720.detail.rss</uri>
421
+ <docidentifier type="ISO">ISO/FDIS 17664-1</docidentifier>
422
+ <docidentifier type="URN">urn:iso:std:iso-fdis:17664:-1:stage-50.00:ed-1:fr</docidentifier>
423
+ <docnumber>17664</docnumber>
424
+ <contributor>
425
+ <role type="publisher"/>
316
426
  <organization>
317
- <name>ISO/FDIS</name>
427
+ <name>International Organization for Standardization</name>
428
+ <abbreviation>ISO</abbreviation>
429
+ <uri>www.iso.org</uri>
318
430
  </organization>
319
- </owner>
320
- </copyright>
321
- <relation type="obsoletes">
322
- <bibitem type="standard">
323
- <formattedref format="text/plain">ISO 17664:2017</formattedref>
324
- </bibitem>
325
- </relation>
326
- <relation type="instance">
327
- <bibitem type="standard">
328
- <fetched>2020-11-03</fetched>
329
- <title format="text/plain" language="fr" script="Latn" type="title-intro">Traitement de produits de soins de santé</title>
330
- <title format="text/plain" language="fr" script="Latn" type="title-main">Informations relatives au traitement des dispositifs médicaux à fournir par le fabricant du dispositif</title>
331
- <title format="text/plain" language="fr" script="Latn" type="title-part">Partie 1: Titre manque</title>
332
- <title format="text/plain" language="fr" script="Latn" type="main">Traitement de produits de soins de santé — Informations relatives au traitement des dispositifs médicaux à fournir par le fabricant du dispositif — Partie 1: Titre manque</title>
333
- <uri type="src">https://www.iso.org/standard/81720.html</uri>
334
- <uri type="rss">https://www.iso.org/contents/data/standard/08/17/81720.detail.rss</uri>
335
- <docidentifier type="ISO">ISO/FDIS 17664-1</docidentifier>
336
- <docidentifier type="URN">urn:iso:std:iso-fdis:17664:-1:stage-50.00:ed-1:fr</docidentifier>
337
- <docnumber>17664</docnumber>
338
- <contributor>
339
- <role type="publisher"/>
431
+ </contributor>
432
+ <edition>1</edition>
433
+ <language>en</language>
434
+ <language>fr</language>
435
+ <script>Latn</script>
436
+ <status>
437
+ <stage>50</stage>
438
+ <substage>00</substage>
439
+ </status>
440
+ <copyright>
441
+ <from>unknown</from>
442
+ <owner>
340
443
  <organization>
341
- <name>International Organization for Standardization</name>
342
- <abbreviation>ISO</abbreviation>
343
- <uri>www.iso.org</uri>
444
+ <name>ISO/FDIS</name>
344
445
  </organization>
345
- </contributor>
346
- <edition>1</edition>
347
- <language>en</language>
348
- <language>fr</language>
349
- <script>Latn</script>
350
- <status>
351
- <stage>50</stage>
352
- <substage>00</substage>
353
- </status>
354
- <copyright>
355
- <from>unknown</from>
356
- <owner>
357
- <organization>
358
- <name>ISO/FDIS</name>
359
- </organization>
360
- </owner>
361
- </copyright>
362
- <relation type="obsoletes">
363
- <bibitem type="standard">
364
- <formattedref format="text/plain">ISO 17664:2017</formattedref>
365
- </bibitem>
366
- </relation>
367
- <place>Geneva</place>
368
- </bibitem>
369
- </relation>
370
- <place>Geneva</place>
371
- </bibitem>
372
- OUTPUT
373
- end
446
+ </owner>
447
+ </copyright>
448
+ <relation type="obsoletes">
449
+ <bibitem type="standard">
450
+ <formattedref format="text/plain">ISO 17664:2017</formattedref>
451
+ </bibitem>
452
+ </relation>
453
+ <place>Geneva</place>
454
+ </bibitem>
455
+ </relation>
456
+ <place>Geneva</place>
457
+ </bibitem>
458
+ OUTPUT
459
+ end
374
460
  end
375
461
  end
@@ -95,7 +95,7 @@ RSpec.describe Asciidoctor::ISO do
95
95
  </li>
96
96
  </ul>
97
97
  <term id="term-term1">
98
- <preferred>Term1</preferred>
98
+ <preferred><expression><name>Term1</name></expression></preferred>
99
99
  </term>
100
100
  </terms>
101
101
  <clause id="_" obligation="normative">
@@ -103,7 +103,7 @@ RSpec.describe Asciidoctor::ISO do
103
103
  <terms id="_" obligation="normative">
104
104
  <title>Normal Terms</title>
105
105
  <term id="term-term2">
106
- <preferred>Term2</preferred>
106
+ <preferred><expression><name>Term2</name></expression></preferred>
107
107
  </term>
108
108
  </terms>
109
109
  <definitions id="_" obligation="normative">
@@ -292,7 +292,7 @@ RSpec.describe Asciidoctor::ISO do
292
292
  </li>
293
293
  </ul>
294
294
  <term id="term-term1">
295
- <preferred>Term1</preferred>
295
+ <preferred><expression><name>Term1</name></expression></preferred>
296
296
  </term>
297
297
  </terms>
298
298
  </sections>
@@ -30,7 +30,7 @@ RSpec.describe IsoDoc do
30
30
  <terms id="I" obligation="normative">
31
31
  <title>Normal Terms</title>
32
32
  <term id="J">
33
- <preferred>Term2</preferred>
33
+ <preferred><expression><name>Term2</name></expression></preferred>
34
34
  </term>
35
35
  </terms>
36
36
  <definitions id="K">
@@ -111,7 +111,7 @@ RSpec.describe IsoDoc do
111
111
  <title depth="2">3.1<tab/>Normal Terms</title>
112
112
  <term id="J">
113
113
  <name>3.1.1</name>
114
- <preferred>Term2</preferred>
114
+ <preferred><strong>Term2</strong></preferred>
115
115
  </term>
116
116
  </terms>
117
117
  <definitions id="K" inline-header="true">
@@ -199,7 +199,7 @@ RSpec.describe IsoDoc do
199
199
  <h2>3.1&#160; Normal Terms</h2>
200
200
 
201
201
  <p class="TermNum" id="J">3.1.1</p>
202
- <p class="Terms" style="text-align:left;">Term2</p>
202
+ <p class="Terms" style="text-align:left;"><b>Term2</b></p>
203
203
  </div>
204
204
  <div id="K">
205
205
  <span class="zzMoveToFollowing">
@@ -249,13 +249,18 @@ RSpec.describe IsoDoc do
249
249
  </body>
250
250
  </html>
251
251
  OUTPUT
252
- expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({}).convert("test", input, true))
253
- .sub(%r{<localized-strings>.*</localized-strings>}m, "")).to be_equivalent_to xmlpp(presxml)
254
- expect(xmlpp(IsoDoc::Iso::HtmlConvert.new({}).convert("test", presxml, true))).to be_equivalent_to xmlpp(html)
252
+ expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({})
253
+ .convert("test", input, true))
254
+ .sub(%r{<localized-strings>.*</localized-strings>}m, ""))
255
+ .to be_equivalent_to xmlpp(presxml)
256
+ expect(xmlpp(IsoDoc::Iso::HtmlConvert.new({})
257
+ .convert("test", presxml, true)))
258
+ .to be_equivalent_to xmlpp(html)
255
259
  end
256
260
 
257
261
  it "defaults to English" do
258
- output = IsoDoc::Iso::PresentationXMLConvert.new({}).convert("test", <<~"INPUT", true)
262
+ output = IsoDoc::Iso::PresentationXMLConvert.new({})
263
+ .convert("test", <<~"INPUT", true)
259
264
  <iso-standard xmlns="http://riboseinc.com/isoxml">
260
265
  <bibdata>
261
266
  <language>tlh</language>
@@ -283,7 +288,7 @@ RSpec.describe IsoDoc do
283
288
  <terms id="I" obligation="normative">
284
289
  <title>Normal Terms</title>
285
290
  <term id="J">
286
- <preferred>Term2</preferred>
291
+ <preferred><expression><name>Term2</name></expression></preferred>
287
292
  </term>
288
293
  </terms>
289
294
  <definitions id="K">
@@ -334,7 +339,8 @@ RSpec.describe IsoDoc do
334
339
  </bibliography>
335
340
  </iso-standard>
336
341
  INPUT
337
- expect(xmlpp(output).sub(%r{<localized-strings>.*</localized-strings>}m, ""))
342
+ expect(xmlpp(output)
343
+ .sub(%r{<localized-strings>.*</localized-strings>}m, ""))
338
344
  .to be_equivalent_to xmlpp(<<~"OUTPUT")
339
345
  <iso-standard type="presentation" xmlns="http://riboseinc.com/isoxml">
340
346
  <bibdata>
@@ -368,7 +374,7 @@ RSpec.describe IsoDoc do
368
374
  <title depth="2">3.1<tab/>Normal Terms</title>
369
375
  <term id="J">
370
376
  <name>3.1.1</name>
371
- <preferred>Term2</preferred>
377
+ <preferred><strong>Term2</strong></preferred>
372
378
  </term>
373
379
  </terms>
374
380
  <definitions id="K" inline-header="true">
@@ -457,7 +463,7 @@ RSpec.describe IsoDoc do
457
463
  <terms id="I" obligation="normative">
458
464
  <title>Normal Terms</title>
459
465
  <term id="J">
460
- <preferred>Term2</preferred>
466
+ <preferred><expression><name>Term2</name></expression></preferred>
461
467
  </term>
462
468
  </terms>
463
469
  <definitions id="K">
@@ -538,7 +544,7 @@ RSpec.describe IsoDoc do
538
544
  <title depth="2">3.1<tab/>Normal Terms</title>
539
545
  <term id="J">
540
546
  <name>3.1.1</name>
541
- <preferred>Term2</preferred>
547
+ <preferred><strong>Term2</strong></preferred>
542
548
  </term>
543
549
  </terms>
544
550
  <definitions id="K" inline-header="true">
@@ -625,7 +631,7 @@ RSpec.describe IsoDoc do
625
631
  <div id="I">
626
632
  <h2>3.1&#160; Normal Terms</h2>
627
633
  <p class="TermNum" id="J">3.1.1</p>
628
- <p class="Terms" style="text-align:left;">Term2</p>
634
+ <p class="Terms" style="text-align:left;"><b>Term2</b></p>
629
635
  </div>
630
636
  <div id="K">
631
637
  <span class="zzMoveToFollowing">
@@ -686,9 +692,13 @@ RSpec.describe IsoDoc do
686
692
  </body>
687
693
  </html>
688
694
  OUTPUT
689
- expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({}).convert("test", input, true))
690
- .sub(%r{<localized-strings>.*</localized-strings>}m, "")).to be_equivalent_to xmlpp(presxml)
691
- expect(xmlpp(IsoDoc::Iso::HtmlConvert.new({}).convert("test", presxml, true))).to be_equivalent_to xmlpp(html)
695
+ expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({})
696
+ .convert("test", input, true))
697
+ .sub(%r{<localized-strings>.*</localized-strings>}m, ""))
698
+ .to be_equivalent_to xmlpp(presxml)
699
+ expect(xmlpp(IsoDoc::Iso::HtmlConvert.new({})
700
+ .convert("test", presxml, true)))
701
+ .to be_equivalent_to xmlpp(html)
692
702
  end
693
703
 
694
704
  it "processes Simplified Chinese" do
@@ -728,7 +738,7 @@ RSpec.describe IsoDoc do
728
738
  <terms id="I" obligation="normative">
729
739
  <title>Normal Terms</title>
730
740
  <term id="J">
731
- <preferred>Term2</preferred>
741
+ <preferred><expression><name>Term2</name></expression></preferred>
732
742
  </term>
733
743
  </terms>
734
744
  <definitions id="K">
@@ -831,7 +841,7 @@ RSpec.describe IsoDoc do
831
841
  Normal Terms</title>
832
842
  <term id="J">
833
843
  <name>3.1.1</name>
834
- <preferred>Term2</preferred>
844
+ <preferred><strong>Term2</strong></preferred>
835
845
  </term>
836
846
  </terms>
837
847
  <definitions id="K" inline-header="true">
@@ -942,7 +952,7 @@ RSpec.describe IsoDoc do
942
952
  <h1>3 &#12288; Terms, definitions, symbols and abbreviated terms</h1>
943
953
  <div id="I"><h2>3.1 &#12288; Normal Terms</h2>
944
954
  <p class="TermNum" id="J">3.1.1</p>
945
- <p class="Terms" style="text-align:left;">Term2</p>
955
+ <p class="Terms" style="text-align:left;"><b>Term2</b></p>
946
956
  </div><div id="K">
947
957
  <span class='zzMoveToFollowing'>
948
958
  <b>3.2&#12288;</b>
@@ -989,8 +999,12 @@ RSpec.describe IsoDoc do
989
999
  </body>
990
1000
  </html>
991
1001
  OUTPUT
992
- expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({}).convert("test", input, true))
993
- .sub(%r{<localized-strings>.*</localized-strings>}m, "")).to be_equivalent_to xmlpp(presxml)
994
- expect(xmlpp(IsoDoc::Iso::HtmlConvert.new({}).convert("test", presxml, true))).to be_equivalent_to xmlpp(html)
1002
+ expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({})
1003
+ .convert("test", input, true))
1004
+ .sub(%r{<localized-strings>.*</localized-strings>}m, ""))
1005
+ .to be_equivalent_to xmlpp(presxml)
1006
+ expect(xmlpp(IsoDoc::Iso::HtmlConvert.new({})
1007
+ .convert("test", presxml, true)))
1008
+ .to be_equivalent_to xmlpp(html)
995
1009
  end
996
1010
  end
@@ -399,7 +399,7 @@ RSpec.describe IsoDoc do
399
399
  <iso-standard xmlns="http://riboseinc.com/isoxml">
400
400
  <sections>
401
401
  <terms id="Terms">
402
- <term id="B"><preferred>B</preferred>
402
+ <term id="B"><preferred><expression><name>B</name></expression></preferred>
403
403
  <p>
404
404
  <ul>
405
405
  <li><concept><refterm>term0</refterm>
@@ -503,7 +503,7 @@ RSpec.describe IsoDoc do
503
503
  <terms id="Terms" displayorder="2"><title>2</title>
504
504
  <term id='B'>
505
505
  <name>2.1</name>
506
- <preferred>B</preferred>
506
+ <preferred><strong>B</strong></preferred>
507
507
  <p>
508
508
  <ul>
509
509
  <li>
@@ -615,7 +615,7 @@ RSpec.describe IsoDoc do
615
615
  <div id='Terms'>
616
616
  <h1>2</h1>
617
617
  <p class='TermNum' id='B'>2.1</p>
618
- <p class='Terms' style='text-align:left;'>B</p>
618
+ <p class='Terms' style='text-align:left;'><b>B</b></p>
619
619
  <p>
620
620
  <ul>
621
621
  <li>
@@ -774,7 +774,7 @@ RSpec.describe IsoDoc do
774
774
  <sections>
775
775
  <clause id="clause1"><title>Clause 1</title></clause>
776
776
  <terms id="A">
777
- <term id="B"><preferred>B</preferred<
777
+ <term id="B"><preferred><expression><name>B</name></expression></preferred<
778
778
  <p>
779
779
  <ul>
780
780
  <li>
@@ -819,7 +819,7 @@ RSpec.describe IsoDoc do
819
819
  <terms id="A" displayorder="2"><title>2</title>
820
820
  <term id='B'>
821
821
  <name>2.1</name>
822
- <preferred>B</preferred>
822
+ <preferred><strong>B</strong></preferred>
823
823
  <p>
824
824
  <ul>
825
825
  <li>
@@ -862,7 +862,7 @@ RSpec.describe IsoDoc do
862
862
  <div id='A'>
863
863
  <h1>2</h1>
864
864
  <p class='TermNum' id='B'>2.1</p>
865
- <p class='Terms' style='text-align:left;'>B</p>
865
+ <p class='Terms' style='text-align:left;'><b>B</b></p>
866
866
  <p>
867
867
  <ul>
868
868
  <li>
@@ -27,7 +27,7 @@ RSpec.describe IsoDoc do
27
27
  <terms id="I" obligation="normative">
28
28
  <title>Normal Terms</title>
29
29
  <term id="J">
30
- <preferred>Term2</preferred>
30
+ <preferred><expression><name>Term2</name></expression></preferred>
31
31
  </term>
32
32
  </terms>
33
33
  <definitions id="K">
@@ -110,7 +110,7 @@ RSpec.describe IsoDoc do
110
110
  <terms id="I" obligation="normative">
111
111
  <title depth="2">3.1<tab/>Normal Terms</title>
112
112
  <term id="J"><name>3.1.1</name>
113
- <preferred>Term2</preferred>
113
+ <preferred><strong>Term2</strong></preferred>
114
114
  </term>
115
115
  </terms>
116
116
  <definitions id="K" inline-header="true"><title>3.2</title>
@@ -196,7 +196,7 @@ RSpec.describe IsoDoc do
196
196
  <div id="I">
197
197
  <h2>3.1&#160; Normal Terms</h2>
198
198
  <p class="TermNum" id="J">3.1.1</p>
199
- <p class="Terms" style="text-align:left;">Term2</p>
199
+ <p class="Terms" style="text-align:left;"><b>Term2</b></p>
200
200
  </div>
201
201
  <div id="K">
202
202
  <span class="zzMoveToFollowing">
@@ -321,7 +321,7 @@ RSpec.describe IsoDoc do
321
321
  <span style="mso-tab-count:1">&#160; </span>
322
322
  Normal Terms</h2>
323
323
  <p class="TermNum" id="J">3.1.1</p>
324
- <p class="Terms" style="text-align:left;">Term2</p>
324
+ <p class="Terms" style="text-align:left;"><b>Term2</b></p>
325
325
  </div>
326
326
  <div id="K">
327
327
  <span class="zzMoveToFollowing">
@@ -368,14 +368,12 @@ RSpec.describe IsoDoc do
368
368
  </td>
369
369
  </tr>
370
370
  </tfoot>
371
- </table>
372
- <table class="dl">
373
- <tr>
374
- <td align="left" valign="top">
375
- <p align="left" class="MsoNormal" style="margin-left:0pt;text-align:left;">Drago</p>
376
- </td>
377
- <td valign="top">A type of rice</td>
378
- </tr>
371
+ <dl>
372
+ <dt>
373
+ <p align='left' style='margin-left:0pt;text-align:left;' class='MsoNormal'>Drago</p>
374
+ </dt>
375
+ <dd>A type of rice</dd>
376
+ </dl>
379
377
  </table>
380
378
  </div>
381
379
  OUTPUT