metanorma-iec 2.0.8 → 2.1.0

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.
@@ -84,7 +84,7 @@ RSpec.describe IsoDoc do
84
84
  <language current="true">en</language>
85
85
  <ext>
86
86
  <doctype language="">international-standard</doctype><doctype language="fr">Norme internationale</doctype><doctype language="en">International Standard</doctype>
87
- <horizontal language="">true</horizontal><horizontal language="fr">Norme horizontale</horizontal><horizontal language="en">Horizontal Standard</horizontal>
87
+ <horizontal language=''>true</horizontal><horizontal language="fr">Norme horizontale</horizontal><horizontal language="en">Horizontal Standard</horizontal>
88
88
  <function language="">emc</function><function language="fr">Publication fondamentale en CEM</function><function language="en">Basic EMC Publication</function>
89
89
  </ext>
90
90
  </bibdata>
@@ -224,12 +224,17 @@ RSpec.describe IsoDoc do
224
224
  </body>
225
225
  </html>
226
226
  OUTPUT
227
- expect((IsoDoc::Iec::PresentationXMLConvert.new({}).convert("test", input, true).sub(%r{<localized-strings>.*</localized-strings>}m, ""))).to be_equivalent_to xmlpp(presxml)
228
- expect(xmlpp(IsoDoc::Iec::HtmlConvert.new({}).convert("test", presxml, true))).to be_equivalent_to xmlpp(html)
227
+ expect(xmlpp(IsoDoc::Iec::PresentationXMLConvert.new({})
228
+ .convert("test", input, true)
229
+ .sub(%r{<localized-strings>.*</localized-strings>}m, "")))
230
+ .to be_equivalent_to xmlpp(presxml)
231
+ expect(xmlpp(IsoDoc::Iec::HtmlConvert.new({})
232
+ .convert("test", presxml, true)))
233
+ .to be_equivalent_to xmlpp(html)
229
234
  end
230
235
 
231
236
  it "defaults to English" do
232
- expect(xmlpp(IsoDoc::Iec::PresentationXMLConvert.new({}).convert("test", <<~"INPUT", true).sub(%r{<localized-strings>.*</localized-strings>}m, ""))).to be_equivalent_to xmlpp(<<~"OUTPUT")
237
+ input = <<~INPUT
233
238
  <iso-standard xmlns="http://riboseinc.com/isoxml">
234
239
  <bibdata>
235
240
  <language>tlh</language>
@@ -297,6 +302,7 @@ RSpec.describe IsoDoc do
297
302
  </bibliography>
298
303
  </iso-standard>
299
304
  INPUT
305
+ output = <<~OUTPUT
300
306
  <iso-standard xmlns="http://riboseinc.com/isoxml" type="presentation">
301
307
  <bibdata>
302
308
  <language current="true">tlh</language>
@@ -362,6 +368,10 @@ RSpec.describe IsoDoc do
362
368
  </bibliography>
363
369
  </iso-standard>
364
370
  OUTPUT
371
+ expect(xmlpp(IsoDoc::Iec::PresentationXMLConvert.new({})
372
+ .convert("test", input, true)
373
+ .sub(%r{<localized-strings>.*</localized-strings>}m, "")))
374
+ .to be_equivalent_to xmlpp(output)
365
375
  end
366
376
 
367
377
  it "processes French" do
@@ -445,7 +455,7 @@ RSpec.describe IsoDoc do
445
455
  <language current="true">fr</language>
446
456
  <ext>
447
457
  <doctype language="">international-standard</doctype><doctype language="fr">Norme internationale</doctype><doctype language="en">International Standard</doctype>
448
- <horizontal language="">false</horizontal>
458
+ <horizontal>false</horizontal>
449
459
  <function language="">emc</function><function language="fr">Publication fondamentale en CEM</function><function language="en">Basic EMC Publication</function>
450
460
  </ext>
451
461
  </bibdata>
@@ -586,7 +596,12 @@ RSpec.describe IsoDoc do
586
596
  </body>
587
597
  </html>
588
598
  OUTPUT
589
- expect(xmlpp(IsoDoc::Iec::PresentationXMLConvert.new({}).convert("test", input, true).sub(%r{<localized-strings>.*</localized-strings>}m, ""))).to be_equivalent_to xmlpp(presxml)
590
- expect(xmlpp(IsoDoc::Iec::HtmlConvert.new({}).convert("test", presxml, true))).to be_equivalent_to xmlpp(html)
599
+ expect(xmlpp(IsoDoc::Iec::PresentationXMLConvert.new({})
600
+ .convert("test", input, true)
601
+ .sub(%r{<localized-strings>.*</localized-strings>}m, "")))
602
+ .to be_equivalent_to xmlpp(presxml)
603
+ expect(xmlpp(IsoDoc::Iec::HtmlConvert.new({})
604
+ .convert("test", presxml, true)))
605
+ .to be_equivalent_to xmlpp(html)
591
606
  end
592
607
  end
@@ -171,7 +171,7 @@ RSpec.describe IsoDoc do
171
171
  <stage language="">60</stage>
172
172
  <stage language='fr'>Norme internationale</stage>
173
173
  <stage language='en'>International standard</stage>
174
- <substage language="">60</substage>
174
+ <substage>60</substage>
175
175
  </status>
176
176
  <copyright>
177
177
  <from>2020</from>
@@ -183,7 +183,7 @@ RSpec.describe IsoDoc do
183
183
  </owner>
184
184
  </copyright>
185
185
  <ext>
186
- <doctype language="">article</doctype>
186
+ <doctype>article</doctype>
187
187
  <editorialgroup>
188
188
  <technical-committee/>
189
189
  <subcommittee/>
@@ -598,7 +598,7 @@ RSpec.describe IsoDoc do
598
598
  <doctype language=''>international-standard</doctype>
599
599
  <doctype language='fr'>Norme internationale</doctype>
600
600
  <doctype language='en'>International Standard</doctype>
601
- <horizontal language=''>false</horizontal>
601
+ <horizontal>false</horizontal>
602
602
  <structuredidentifier>
603
603
  <project-number part='192'>IEC 60050</project-number>
604
604
  </structuredidentifier>
@@ -621,7 +621,7 @@ RSpec.describe IsoDoc do
621
621
  <termnote id='_5f49cfad-e57e-5029-78cf-5b7e3e10a3b3'>
622
622
  <name>Note 1 to entry</name>
623
623
  <p id='_8c830e60-8f09-73a2-6393-2a27d9c5b1ce'>Dependability includes availability (<em>192-01-02</em>
624
- (<xref target='term-sub-item'>192-01-02</xref>),
624
+ (<xref target='term-sub-item'><span class='citesec'>192-01-02</span></xref>),
625
625
  <em>191-01-02</em>
626
626
  [term defined in
627
627
  <termref base='IEV' target='191-01-02'/>])</p>
@@ -740,7 +740,7 @@ RSpec.describe IsoDoc do
740
740
  CONTRAST:
741
741
  <strong>Fifth Designation</strong>
742
742
  (
743
- <xref target='paddy1'>192-01-02</xref>
743
+ <xref target='paddy1'><span class='citesec'>192-01-02</span></xref>
744
744
  )
745
745
  </p>
746
746
  <termexample id='_671a1994-4783-40d0-bc81-987d06ffb740'>
@@ -786,14 +786,14 @@ RSpec.describe IsoDoc do
786
786
  CONTRASTEZ:
787
787
  <strong>Designation cinqui&#xE8;me</strong>
788
788
  (
789
- <xref target='paddy1'>192-01-02</xref>
789
+ <xref target='paddy1'><span class='citesec'>192-01-02</span></xref>
790
790
  )
791
791
  </p>
792
792
  <p>
793
793
  VOIR:
794
794
  <strong>Designation sixi&#xE8;me</strong>
795
795
  (
796
- <xref target='paddy1'>192-01-02</xref>
796
+ <xref target='paddy1'><span class='citesec'>192-01-02</span></xref>
797
797
  )
798
798
  </p>
799
799
  <termexample id='_671a1994-4783-40d0-bc81-987d06ffb741'>