metanorma-iso 1.10.0 → 1.10.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) 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/base.rb +1 -1
  8. data/lib/asciidoctor/iso/cleanup.rb +7 -6
  9. data/lib/asciidoctor/iso/front.rb +2 -2
  10. data/lib/asciidoctor/iso/isodoc.rng +68 -18
  11. data/lib/asciidoctor/iso/isostandard.rng +14 -0
  12. data/lib/asciidoctor/iso/section.rb +1 -1
  13. data/lib/asciidoctor/iso/validate.rb +1 -1
  14. data/lib/asciidoctor/iso/validate_section.rb +1 -1
  15. data/lib/isodoc/iso/html/isodoc.css +0 -1
  16. data/lib/isodoc/iso/html/isodoc.scss +0 -1
  17. data/lib/isodoc/iso/html/style-human.css +21 -1
  18. data/lib/isodoc/iso/html/style-human.scss +26 -1
  19. data/lib/isodoc/iso/html/style-iso.css +21 -1
  20. data/lib/isodoc/iso/html/style-iso.scss +26 -1
  21. data/lib/isodoc/iso/html_convert.rb +81 -22
  22. data/lib/isodoc/iso/i18n.rb +10 -9
  23. data/lib/isodoc/iso/iso.amendment.xsl +304 -118
  24. data/lib/isodoc/iso/iso.international-standard.xsl +304 -118
  25. data/lib/isodoc/iso/isosts_convert.rb +6 -2
  26. data/lib/isodoc/iso/presentation_xml_convert.rb +19 -9
  27. data/lib/isodoc/iso/sections.rb +2 -0
  28. data/lib/isodoc/iso/sts_convert.rb +5 -2
  29. data/lib/isodoc/iso/word_cleanup.rb +94 -0
  30. data/lib/isodoc/iso/word_convert.rb +12 -91
  31. data/lib/metanorma/iso/processor.rb +2 -2
  32. data/lib/metanorma/iso/version.rb +1 -1
  33. data/metanorma-iso.gemspec +3 -3
  34. data/spec/asciidoctor/base_spec.rb +543 -209
  35. data/spec/asciidoctor/blocks_spec.rb +4 -43
  36. data/spec/asciidoctor/cleanup_spec.rb +15 -12
  37. data/spec/asciidoctor/refs_spec.rb +174 -88
  38. data/spec/isodoc/i18n_spec.rb +32 -18
  39. data/spec/isodoc/inline_spec.rb +4 -4
  40. data/spec/isodoc/postproc_spec.rb +111 -28
  41. data/spec/isodoc/section_spec.rb +3 -3
  42. data/spec/isodoc/table_spec.rb +6 -8
  43. data/spec/isodoc/terms_spec.rb +30 -37
  44. data/spec/isodoc/xref_spec.rb +3 -3
  45. data/spec/metanorma/processor_spec.rb +110 -14
  46. data/spec/vcr_cassettes/docrels.yml +783 -0
  47. data/spec/vcr_cassettes/sortrefs.yml +599 -0
  48. metadata +12 -8
@@ -535,9 +535,9 @@ RSpec.describe Asciidoctor::ISO do
535
535
  <term id="term-term1">
536
536
  <preferred><expression><name>Term1</name></expression></preferred>
537
537
  <definition>
538
- <verbaldefinition>
538
+ <verbal-definition>
539
539
  <p id='_'>Definition</p>
540
- </verbaldefinition>
540
+ </verbal-definition>
541
541
  </definition>
542
542
  <termsource status='identical' type='authoritative'>
543
543
  <origin bibitemid="ISO2191" citeas="" type="inline">
@@ -577,9 +577,9 @@ RSpec.describe Asciidoctor::ISO do
577
577
  <term id="term-term1">
578
578
  <preferred><expression><name>Term1</name></expression></preferred>
579
579
  <definition>
580
- <verbaldefinition>
580
+ <verbal-definition>
581
581
  <p id='_'>Definition</p>
582
- </verbaldefinition>
582
+ </verbal-definition>
583
583
  </definition>
584
584
  <termsource status='modified' type='authoritative'>
585
585
  <origin bibitemid="ISO2191" citeas="" type="inline">
@@ -600,43 +600,4 @@ RSpec.describe Asciidoctor::ISO do
600
600
  expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
601
601
  .to be_equivalent_to xmlpp(output)
602
602
  end
603
-
604
- it "processes nested terms" do
605
- input = <<~INPUT
606
- #{ASCIIDOC_BLANK_HDR}
607
- == Terms and Definitions
608
-
609
- [.term]
610
- === Term1
611
-
612
- definition
613
-
614
- ==== Term11
615
- definition2
616
- INPUT
617
- output = <<~OUTPUT
618
- #{BLANK_HDR}
619
- <sections>
620
- <terms id='_' obligation='normative'>
621
- <title>Terms and definitions</title>
622
- #{TERM_BOILERPLATE}
623
- <term id='term-term1'>
624
- <preferred><expression><name>Term1</name></expression></preferred>
625
- <definition><verbaldefinition>
626
- <p id='_'>definition</p>
627
- </verbaldefinition></definition>
628
- <term id='term-term11'>
629
- <preferred><expression><name>Term11</name></expression></preferred>
630
- <definition><verbaldefinition>
631
- <p id='_'>definition2</p>
632
- </verbaldefinition></definition>
633
- </term>
634
- </term>
635
- </terms>
636
- </sections>
637
- </iso-standard>
638
- OUTPUT
639
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
640
- .to be_equivalent_to xmlpp(output)
641
- end
642
603
  end
@@ -66,9 +66,9 @@ RSpec.describe Asciidoctor::ISO do
66
66
  </stem>
67
67
  </name></letter-symbol>
68
68
  </admitted>
69
- <definition><verbaldefinition>
69
+ <definition><verbal-definition>
70
70
  <p id="_">Time</p>
71
- </verbaldefinition></definition>
71
+ </verbal-definition></definition>
72
72
  </term>
73
73
  </terms>
74
74
  </sections>
@@ -96,8 +96,8 @@ RSpec.describe Asciidoctor::ISO do
96
96
  <term id="term-tempus">
97
97
  <preferred><expression><name>Tempus</name></expression></preferred>
98
98
  <domain>relativity</domain>
99
- <definition><verbaldefinition>
100
- <p id="_">Time</p></verbaldefinition></definition>
99
+ <definition><verbal-definition>
100
+ <p id="_">Time</p></verbal-definition></definition>
101
101
  </term>
102
102
  </terms>
103
103
  </sections>
@@ -121,12 +121,15 @@ RSpec.describe Asciidoctor::ISO do
121
121
 
122
122
  === stem:[t_90]
123
123
 
124
+ [.definition]
125
+ --
124
126
  [stem]
125
127
  ++++
126
128
  t_A
127
129
  ++++
128
130
 
129
131
  This paragraph is extraneous
132
+ --
130
133
  INPUT
131
134
  output = <<~OUTPUT
132
135
  #{BLANK_HDR}
@@ -134,7 +137,7 @@ RSpec.describe Asciidoctor::ISO do
134
137
  <terms id="_" obligation="normative">
135
138
  <title>Terms and definitions</title>
136
139
  #{TERM_BOILERPLATE}
137
- <term id="term-t90">
140
+ <term id="term-_-t90-">
138
141
  <preferred>
139
142
  <letter-symbol><name>
140
143
  <stem type="MathML">
@@ -151,8 +154,7 @@ RSpec.describe Asciidoctor::ISO do
151
154
  </name></letter-symbol>
152
155
  </preferred>
153
156
  <definition>
154
- <verbaldefinition><p id="_">This paragraph is extraneous</p></verbaldefinition>
155
- <nonverbalrepresentation>
157
+ <verbal-definition>
156
158
  <formula id="_">
157
159
  <stem type="MathML">
158
160
  <math xmlns="http://www.w3.org/1998/Math/MathML">
@@ -167,7 +169,8 @@ RSpec.describe Asciidoctor::ISO do
167
169
  </math>
168
170
  </stem>
169
171
  </formula>
170
- </nonverbalrepresentation></definition>
172
+ <p id="_">This paragraph is extraneous</p></verbal-definition>
173
+ </definition>
171
174
  </term>
172
175
  </terms>
173
176
  </sections>
@@ -203,9 +206,9 @@ RSpec.describe Asciidoctor::ISO do
203
206
  </ul>
204
207
  <term id="term-time">
205
208
  <preferred><expression><name>Time</name></expression></preferred>
206
- <definition><verbaldefinition>
209
+ <definition><verbal-definition>
207
210
  <p id="_">This paragraph is extraneous</p>
208
- </verbaldefinition></definition>
211
+ </verbal-definition></definition>
209
212
  </term>
210
213
  </terms>
211
214
  </sections>
@@ -454,9 +457,9 @@ RSpec.describe Asciidoctor::ISO do
454
457
  <term id="term-term1">
455
458
  <preferred><expression><name>Term1</name></expression></preferred>
456
459
  <definition>
457
- <verbaldefinition>
460
+ <verbal-definition>
458
461
  <p id='_'>Definition</p>
459
- </verbaldefinition>
462
+ </verbal-definition>
460
463
  </definition>
461
464
  <termsource status='identical' type='authoritative'>
462
465
  <origin bibitemid="ISO2191" citeas="" type="inline">
@@ -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
@@ -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>
@@ -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">
@@ -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
@@ -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