metanorma-iso 1.8.0 → 1.8.5

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 (52) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/rake.yml +3 -13
  3. data/.hound.yml +3 -1
  4. data/.rubocop.yml +4 -8
  5. data/lib/asciidoctor/iso/base.rb +14 -11
  6. data/lib/asciidoctor/iso/biblio.rng +1 -0
  7. data/lib/asciidoctor/iso/cleanup.rb +40 -24
  8. data/lib/asciidoctor/iso/front.rb +28 -16
  9. data/lib/asciidoctor/iso/front_id.rb +66 -50
  10. data/lib/asciidoctor/iso/isodoc.rng +191 -3
  11. data/lib/asciidoctor/iso/isostandard-amd.rng +3 -0
  12. data/lib/asciidoctor/iso/isostandard.rng +12 -0
  13. data/lib/asciidoctor/iso/section.rb +2 -1
  14. data/lib/asciidoctor/iso/validate.rb +22 -110
  15. data/lib/asciidoctor/iso/validate_image.rb +97 -0
  16. data/lib/asciidoctor/iso/validate_requirements.rb +26 -20
  17. data/lib/asciidoctor/iso/validate_section.rb +55 -29
  18. data/lib/asciidoctor/iso/validate_style.rb +36 -24
  19. data/lib/asciidoctor/iso/validate_title.rb +2 -4
  20. data/lib/isodoc/iso/base_convert.rb +20 -14
  21. data/lib/isodoc/iso/html/isodoc.css +475 -20
  22. data/lib/isodoc/iso/html/isodoc.scss +456 -23
  23. data/lib/isodoc/iso/html/wordstyle.css +202 -31
  24. data/lib/isodoc/iso/html/wordstyle.scss +194 -32
  25. data/lib/isodoc/iso/iso.amendment.xsl +666 -193
  26. data/lib/isodoc/iso/iso.international-standard.xsl +666 -193
  27. data/lib/isodoc/iso/metadata.rb +3 -2
  28. data/lib/isodoc/iso/presentation_xml_convert.rb +15 -14
  29. data/lib/isodoc/iso/sts_convert.rb +10 -13
  30. data/lib/isodoc/iso/word_convert.rb +153 -39
  31. data/lib/isodoc/iso/xref.rb +44 -29
  32. data/lib/metanorma/iso/processor.rb +1 -0
  33. data/lib/metanorma/iso/version.rb +1 -1
  34. data/metanorma-iso.gemspec +3 -3
  35. data/spec/asciidoctor/base_spec.rb +426 -305
  36. data/spec/asciidoctor/blocks_spec.rb +96 -34
  37. data/spec/asciidoctor/cleanup_spec.rb +383 -25
  38. data/spec/asciidoctor/section_spec.rb +0 -14
  39. data/spec/asciidoctor/validate_spec.rb +218 -83
  40. data/spec/isodoc/amd_spec.rb +193 -201
  41. data/spec/isodoc/blocks_spec.rb +100 -88
  42. data/spec/isodoc/i18n_spec.rb +36 -36
  43. data/spec/isodoc/inline_spec.rb +2 -2
  44. data/spec/isodoc/iso_spec.rb +86 -138
  45. data/spec/isodoc/postproc_spec.rb +492 -442
  46. data/spec/isodoc/ref_spec.rb +6 -6
  47. data/spec/isodoc/section_spec.rb +301 -306
  48. data/spec/isodoc/table_spec.rb +166 -231
  49. data/spec/isodoc/terms_spec.rb +11 -8
  50. data/spec/isodoc/xref_spec.rb +147 -118
  51. data/spec/spec_helper.rb +16 -15
  52. metadata +8 -7
@@ -155,7 +155,7 @@ RSpec.describe IsoDoc do
155
155
  <language current="true">en</language>
156
156
  </bibdata>
157
157
  <preface>
158
- <foreword>
158
+ <foreword displayorder="1">
159
159
  <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">
160
160
  <eref bibitemid="ISO712">ISO 712</eref>
161
161
  <eref bibitemid="ISBN">[1]</eref>
@@ -168,7 +168,7 @@ RSpec.describe IsoDoc do
168
168
  </foreword>
169
169
  </preface>
170
170
  <bibliography>
171
- <references id="_normative_references" normative="true" obligation="informative">
171
+ <references id="_normative_references" normative="true" obligation="informative" displayorder="2">
172
172
  <title depth="1">1<tab/>Normative References</title>
173
173
  <p>The following documents are referred to in the text in such a way that
174
174
  some or all of their content constitutes requirements of this document.
@@ -231,14 +231,14 @@ RSpec.describe IsoDoc do
231
231
 
232
232
  <link target="http://www.icc.or.at"/>
233
233
  )</formattedref>
234
- <docidentifier type="ICC">167</docidentifier>
234
+ <docidentifier type="ICC">ICC 167</docidentifier>
235
235
  </bibitem>
236
236
  <note>
237
237
  <name>NOTE</name>
238
238
  <p>This is an annotation of ISO 20483:2013-2014</p>
239
239
  </note>
240
240
  </references>
241
- <references id="_bibliography" normative="false" obligation="informative">
241
+ <references id="_bibliography" normative="false" obligation="informative" displayorder="3">
242
242
  <title depth="1">Bibliography</title>
243
243
  <bibitem id="ISBN" type="ISBN">
244
244
  <title format="text/plain">Chemicals for analytical laboratory use</title>
@@ -294,7 +294,7 @@ RSpec.describe IsoDoc do
294
294
  </bibitem>
295
295
  <bibitem id="ref11">
296
296
  <title>Internet Calendaring and Scheduling Core Object Specification (iCalendar)</title>
297
- <docidentifier type="IETF">RFC 10</docidentifier>
297
+ <docidentifier type="IETF">IETF RFC 10</docidentifier>
298
298
  </bibitem>
299
299
  <bibitem id="ref12">
300
300
  <formattedref format="application/x-isodoc+xml">CitationWorks. 2019.
@@ -302,7 +302,7 @@ RSpec.describe IsoDoc do
302
302
  <em>How to cite a reference</em>
303
303
  .</formattedref>
304
304
  <docidentifier type="metanorma">[Citn]</docidentifier>
305
- <docidentifier type="IETF">RFC 20</docidentifier>
305
+ <docidentifier type="IETF">IETF RFC 20</docidentifier>
306
306
  </bibitem>
307
307
  </references>
308
308
  </bibliography>
@@ -86,100 +86,86 @@ RSpec.describe IsoDoc do
86
86
  INPUT
87
87
 
88
88
  presxml = <<~OUTPUT
89
- <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
90
- <preface>
91
- <foreword obligation='informative'>
92
- <title>Foreword</title>
93
- <p id='A'>This is a preamble</p>
94
- </foreword>
95
- <introduction id='B' obligation='informative'>
96
- <title depth='1'>0<tab/>Introduction</title>
97
- <clause id='C' inline-header='false' obligation='informative'>
98
- <title depth='2'>0.1<tab/>Introduction Subsection</title>
89
+ <iso-standard xmlns="http://riboseinc.com/isoxml" type="presentation">
90
+ <preface>
91
+ <foreword obligation="informative" displayorder="1">
92
+ <title>Foreword</title>
93
+ <p id="A">This is a preamble</p>
94
+ </foreword>
95
+ <introduction id="B" obligation="informative" displayorder="2">
96
+ <title depth="1">0<tab/>Introduction</title>
97
+ <clause id="C" inline-header="false" obligation="informative">
98
+ <title depth="2">0.1<tab/>Introduction Subsection</title>
99
+ </clause>
100
+ <p>This is patent boilerplate</p>
101
+ </introduction>
102
+ </preface>
103
+ <sections>
104
+ <clause id="D" obligation="normative" type="scope" displayorder="3">
105
+ <title depth="1">1<tab/>Scope</title>
106
+ <p id="E">Text</p>
99
107
  </clause>
100
- <p>This is patent boilerplate</p>
101
- </introduction>
102
- </preface>
103
- <sections>
104
- <clause id='D' obligation='normative' type="scope">
105
- <title depth='1'>1<tab/>Scope</title>
106
- <p id='E'>Text</p>
107
- </clause>
108
- <clause id='H' obligation='normative'>
109
- <title depth='1'>3<tab/>Terms, Definitions, Symbols and Abbreviated Terms</title>
110
- <terms id='I' obligation='normative'>
111
- <title depth='2'>3.1<tab/>Normal Terms</title>
112
- <term id='J'>
113
- <name>3.1.1</name>
114
- <preferred>Term2</preferred>
115
- </term>
116
- </terms>
117
- <definitions id='K' inline-header='true'>
118
- <title>3.2</title>
108
+ <clause id="H" obligation="normative" displayorder="5">
109
+ <title depth="1">3<tab/>Terms, Definitions, Symbols and Abbreviated Terms</title>
110
+ <terms id="I" obligation="normative">
111
+ <title depth="2">3.1<tab/>Normal Terms</title>
112
+ <term id="J"><name>3.1.1</name>
113
+ <preferred>Term2</preferred>
114
+ </term>
115
+ </terms>
116
+ <definitions id="K" inline-header="true"><title>3.2</title>
117
+ <dl>
118
+ <dt>Symbol</dt>
119
+ <dd>Definition</dd>
120
+ </dl>
121
+ </definitions>
122
+ </clause>
123
+ <definitions id="L" displayorder="6"><title>4</title>
119
124
  <dl>
120
125
  <dt>Symbol</dt>
121
126
  <dd>Definition</dd>
122
127
  </dl>
123
128
  </definitions>
124
- </clause>
125
- <definitions id='L'>
126
- <title>4</title>
127
- <dl>
128
- <dt>Symbol</dt>
129
- <dd>Definition</dd>
130
- </dl>
131
- </definitions>
132
- <clause id='M' inline-header='false' obligation='normative'>
133
- <title depth='1'>5<tab/>Clause 4</title>
134
- <clause id='N' inline-header='false' obligation='normative'>
135
- <title depth='2'>5.1<tab/>Introduction</title>
136
- </clause>
137
- <clause id='O' inline-header='false' obligation='normative'>
138
- <title depth='2'>5.2<tab/>Clause 4.2</title>
139
- </clause>
140
- </clause>
141
- </sections>
142
- <annex id='P' inline-header='false' obligation='normative'>
143
- <title>
144
- <strong>Annex A</strong>
145
- <br/>
146
- (normative)
147
- <br/>
148
- <br/>
149
- <strong>Annex</strong>
150
- </title>
151
- <clause id='Q' inline-header='false' obligation='normative'>
152
- <title depth='2'>A.1<tab/>Annex A.1</title>
153
- <clause id='Q1' inline-header='false' obligation='normative'>
154
- <title depth='3'>A.1.1<tab/>Annex A.1a</title>
129
+ <clause id="M" inline-header="false" obligation="normative" displayorder="7">
130
+ <title depth="1">5<tab/>Clause 4</title>
131
+ <clause id="N" inline-header="false" obligation="normative">
132
+ <title depth="2">5.1<tab/>Introduction</title>
133
+ </clause>
134
+ <clause id="O" inline-header="false" obligation="normative">
135
+ <title depth="2">5.2<tab/>Clause 4.2</title>
136
+ </clause>
155
137
  </clause>
156
- </clause>
157
- <appendix id='Q2' inline-header='false' obligation='normative'>
158
- <title depth='2'>Appendix 1<tab/>An Appendix</title>
159
- <clause id='Q2a' inline-header='false' obligation='normative'>
160
- <title depth='3'>
161
- Appendix 1.1
162
- <tab/>
163
- Appendix subclause
164
- </title>
138
+ </sections>
139
+ <annex id="P" inline-header="false" obligation="normative" displayorder="8">
140
+ <title><strong>Annex A</strong><br/>(normative)<br/><br/><strong>Annex</strong></title>
141
+ <clause id="Q" inline-header="false" obligation="normative">
142
+ <title depth="2">A.1<tab/>Annex A.1</title>
143
+ <clause id="Q1" inline-header="false" obligation="normative">
144
+ <title depth="3">A.1.1<tab/>Annex A.1a</title>
145
+ </clause>
165
146
  </clause>
166
- </appendix>
167
- <references id='Q3' normative='false'>
168
- <title depth='2'>A.2<tab/>Annex Bibliography</title>
169
- </references>
170
- </annex>
171
- <bibliography>
172
- <references id='R' obligation='informative' normative='true'>
173
- <title depth='1'>2<tab/>Normative References</title>
174
- </references>
175
- <clause id='S' obligation='informative'>
176
- <title depth='1'>Bibliography</title>
177
- <references id='T' obligation='informative' normative='false'>
178
- <title depth='2'>Bibliography Subsection</title>
147
+ <appendix id="Q2" inline-header="false" obligation="normative">
148
+ <title depth="2">Appendix 1<tab/>An Appendix</title>
149
+ <clause id="Q2a" inline-header="false" obligation="normative">
150
+ <title depth="3">Appendix 1.1<tab/>Appendix subclause</title>
151
+ </clause>
152
+ </appendix>
153
+ <references id="Q3" normative="false">
154
+ <title depth="2">A.2<tab/>Annex Bibliography</title>
179
155
  </references>
180
- </clause>
181
- </bibliography>
182
- </iso-standard>
156
+ </annex>
157
+ <bibliography>
158
+ <references id="R" normative="true" obligation="informative" displayorder="4">
159
+ <title depth="1">2<tab/>Normative References</title>
160
+ </references>
161
+ <clause id="S" obligation="informative" displayorder="9">
162
+ <title depth="1">Bibliography</title>
163
+ <references id="T" normative="false" obligation="informative">
164
+ <title depth="2">Bibliography Subsection</title>
165
+ </references>
166
+ </clause>
167
+ </bibliography>
168
+ </iso-standard>
183
169
  OUTPUT
184
170
 
185
171
  html = <<~OUTPUT
@@ -259,7 +245,7 @@ RSpec.describe IsoDoc do
259
245
  <div id="Q2">
260
246
  <h2>Appendix 1&#160; An Appendix</h2>
261
247
  <div id="Q2a">
262
- <h3>Appendix 1.1 &#160; Appendix subclause </h3>
248
+ <h3>Appendix 1.1&#160; Appendix subclause</h3>
263
249
  </div>
264
250
  </div>
265
251
  <div>
@@ -281,7 +267,7 @@ RSpec.describe IsoDoc do
281
267
  word = <<~OUTPUT
282
268
  <body lang="EN-US" link="blue" vlink="#954F72">
283
269
  <div class="WordSection1">
284
- <p> </p>
270
+ <p>&#160;</p>
285
271
  </div>
286
272
  <p>
287
273
  <br class="section" clear="all"/>
@@ -292,7 +278,7 @@ RSpec.describe IsoDoc do
292
278
  </p>
293
279
  <div>
294
280
  <h1 class="ForewordTitle">Foreword</h1>
295
- <p id="A">This is a preamble</p>
281
+ <p id="A" class='ForewordText'>This is a preamble</p>
296
282
  </div>
297
283
  <p>
298
284
  <br clear="all" style="mso-special-character:line-break;page-break-before:always"/>
@@ -308,7 +294,7 @@ RSpec.describe IsoDoc do
308
294
  </div>
309
295
  <p>This is patent boilerplate</p>
310
296
  </div>
311
- <p> </p>
297
+ <p>&#160;</p>
312
298
  </div>
313
299
  <p>
314
300
  <br class="section" clear="all"/>
@@ -383,7 +369,6 @@ RSpec.describe IsoDoc do
383
369
  </p>
384
370
  <div class="Section3" id="P">
385
371
  <h1 class="Annex">
386
- <b>Annex A</b>
387
372
  <br/>(normative)
388
373
  <br/>
389
374
  <br/>
@@ -409,7 +394,7 @@ RSpec.describe IsoDoc do
409
394
  </div>
410
395
  </div>
411
396
  <div>
412
- <h2 class="Section3">A.2
397
+ <h2 class="BiblioTitle">A.2
413
398
  <span style="mso-tab-count:1">&#160; </span>
414
399
  Annex Bibliography</h2>
415
400
  </div>
@@ -418,9 +403,9 @@ RSpec.describe IsoDoc do
418
403
  <br clear="all" style="mso-special-character:line-break;page-break-before:always"/>
419
404
  </p>
420
405
  <div>
421
- <h1 class="Section3">Bibliography</h1>
406
+ <h1 class="BiblioTitle">Bibliography</h1>
422
407
  <div>
423
- <h2 class="Section3">Bibliography Subsection</h2>
408
+ <h2 class="BiblioTitle">Bibliography Subsection</h2>
424
409
  </div>
425
410
  </div>
426
411
  </div>
@@ -428,12 +413,16 @@ RSpec.describe IsoDoc do
428
413
  <div class="colophon"/>
429
414
  </body>
430
415
  OUTPUT
431
- expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({}).convert("test", input, true)))
416
+ expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({})
417
+ .convert("test", input, true)))
432
418
  .to be_equivalent_to xmlpp(presxml)
433
- expect(xmlpp(IsoDoc::Iso::HtmlConvert.new({}).convert("test", presxml, true)))
419
+ expect(xmlpp(IsoDoc::Iso::HtmlConvert.new({})
420
+ .convert("test", presxml, true)))
434
421
  .to be_equivalent_to xmlpp(html)
435
- expect(xmlpp(IsoDoc::Iso::WordConvert.new({}).convert("test", presxml, true)
436
- .sub(/^.*<body /m, "<body ").sub(%r{</body>.*$}m, "</body>"))).to be_equivalent_to xmlpp(word)
422
+ expect(xmlpp(IsoDoc::Iso::WordConvert.new({})
423
+ .convert("test", presxml, true)
424
+ .sub(/^.*<body /m, "<body ").sub(%r{</body>.*$}m, "</body>")))
425
+ .to be_equivalent_to xmlpp(word)
437
426
  end
438
427
 
439
428
  it "processes subclauses with and without titles" do
@@ -455,7 +444,7 @@ RSpec.describe IsoDoc do
455
444
  presxml = <<~OUTPUT
456
445
  <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
457
446
  <sections>
458
- <clause id='D' obligation='normative'>
447
+ <clause id='D' obligation='normative' displayorder="1">
459
448
  <title depth='1'>1<tab/>Scope</title>
460
449
  <clause id='D1' obligation='normative'>
461
450
  <title depth='2'>1.1<tab/>Scope 1</title>
@@ -497,38 +486,42 @@ RSpec.describe IsoDoc do
497
486
  </body>
498
487
  </html>
499
488
  OUTPUT
500
- expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({}).convert("test", input, true)))
489
+ expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({})
490
+ .convert("test", input, true)))
501
491
  .to be_equivalent_to xmlpp(presxml)
502
- expect(xmlpp(IsoDoc::Iso::HtmlConvert.new({}).convert("test", presxml, true)))
492
+ expect(xmlpp(IsoDoc::Iso::HtmlConvert.new({})
493
+ .convert("test", presxml, true)))
503
494
  .to be_equivalent_to xmlpp(html)
504
495
  end
505
496
 
506
497
  it "processes simple terms & definitions" do
507
- expect(xmlpp(IsoDoc::Iso::HtmlConvert.new({})
508
- .convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
509
- <iso-standard xmlns="http://riboseinc.com/isoxml">
510
- <sections>
511
- <terms id="H" obligation="normative">
512
- <title>Terms, Definitions, Symbols and Abbreviated Terms</title>
513
- <term id="J">
514
- <name>1.1</name>
515
- <preferred>Term2</preferred>
516
- </term>
517
- </terms>
518
- </sections>
519
- </iso-standard>
520
- INPUT
521
- #{HTML_HDR}
522
- <p class="zzSTDTitle1"/>
523
- <div id="H">
524
- <h1>Terms, Definitions, Symbols and Abbreviated Terms</h1>
525
- <p class="TermNum" id="J">1.1</p>
526
- <p class="Terms" style="text-align:left;">Term2</p>
527
- </div>
498
+ input = <<~INPUT
499
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
500
+ <sections>
501
+ <terms id="H" obligation="normative">
502
+ <title>Terms, Definitions, Symbols and Abbreviated Terms</title>
503
+ <term id="J">
504
+ <name>1.1</name>
505
+ <preferred>Term2</preferred>
506
+ </term>
507
+ </terms>
508
+ </sections>
509
+ </iso-standard>
510
+ INPUT
511
+ output = <<~OUTPUT
512
+ #{HTML_HDR}
513
+ <p class="zzSTDTitle1"/>
514
+ <div id="H">
515
+ <h1>Terms, Definitions, Symbols and Abbreviated Terms</h1>
516
+ <p class="TermNum" id="J">1.1</p>
517
+ <p class="Terms" style="text-align:left;">Term2</p>
528
518
  </div>
529
- </body>
530
- </html>
531
- OUTPUT
519
+ </div>
520
+ </body>
521
+ </html>
522
+ OUTPUT
523
+ expect(xmlpp(IsoDoc::Iso::HtmlConvert.new({})
524
+ .convert("test", input, true))).to be_equivalent_to xmlpp(output)
532
525
  end
533
526
 
534
527
  it "processes inline section headers" do
@@ -686,191 +679,193 @@ RSpec.describe IsoDoc do
686
679
  </bipm-standard>
687
680
  INPUT
688
681
  presxml = <<~OUTPUT
689
- <iso-standard xmlns='https://open.ribose.com/standards/bipm' type='presentation'>
690
- <bibdata>
691
- <language current='true'>en</language>
692
- <script current='true'>Latn</script>
693
- </bibdata>
694
- <sections>
695
- <clause id='A'>
696
- <title>1</title>
697
- <bookmark id='_'/>
698
- <bookmark id='_'/>
699
- <bookmark id='_'/>
700
- <bookmark id='_'/>
701
- <bookmark id='_'/>
702
- <clause id='B' inline-header='true'>
703
- <title>1.1</title>
704
- <bookmark id='_'/>
705
- <bookmark id='_'/>
706
- <bookmark id='_'/>
707
- <bookmark id='_'/>
708
- </clause>
709
- </clause>
710
- </sections>
711
- <indexsect id='_'>
712
- <title>Index</title>
713
- <ul>
714
- <li>
715
- <em>Dasein</em>
716
- , see
717
- <em>Eman</em>
718
- cipation, &#xEA;tre
719
- </li>
720
- <li>
721
- &#xE9;long&#xE9;,
722
- <xref target='_' pagenumber='true'>Clause 1</xref>
723
- </li>
724
- <li>
725
- <em>Eman</em>
726
- cipation,
727
- <xref target='_' pagenumber='true'>Clause 1</xref>
728
- ,
729
- <xref target='_' pagenumber='true'>1.1</xref>
730
- <ul>
731
- <li>
732
- dans la France,
733
- <xref target='_' pagenumber='true'>Clause 1</xref>
734
- <ul>
735
- <li>
736
- &#xE0; Paris,
737
- <xref target='_' pagenumber='true'>1.1</xref>
738
- </li>
739
- <li>
740
- en Bretagne,
741
- <xref target='_' pagenumber='true'>Clause 1</xref>
742
- </li>
743
- </ul>
744
- </li>
745
- <li>
746
- dans les &#xC9;tats-Unis,
747
- <xref target='_' pagenumber='true'>1.1</xref>
748
- </li>
749
- </ul>
750
- </li>
751
- <li>
752
- &#xEA;tre
753
- <ul>
754
- <li>
755
- Husserl, see zebra, see also
756
- <em>Eman</em>
757
- cipation, zebra
758
- <ul>
759
- <li>
760
- en allemand,
761
- <xref target='_' pagenumber='true'>Clause 1</xref>
762
- </li>
763
- </ul>
764
- </li>
765
- </ul>
766
- </li>
767
- <li>
768
- zebra,
769
- <xref target='_' pagenumber='true'>1.1</xref>
770
- </li>
771
- </ul>
772
- </indexsect>
773
- </iso-standard>
682
+ <iso-standard xmlns='https://open.ribose.com/standards/bipm' type='presentation'>
683
+ <bibdata>
684
+ <language current='true'>en</language>
685
+ <script current='true'>Latn</script>
686
+ </bibdata>
687
+ <sections>
688
+ <clause id='A' displayorder="1">
689
+ <title>1</title>
690
+ <bookmark id='_'/>
691
+ <bookmark id='_'/>
692
+ <bookmark id='_'/>
693
+ <bookmark id='_'/>
694
+ <bookmark id='_'/>
695
+ <clause id='B' inline-header='true'>
696
+ <title>1.1</title>
697
+ <bookmark id='_'/>
698
+ <bookmark id='_'/>
699
+ <bookmark id='_'/>
700
+ <bookmark id='_'/>
701
+ </clause>
702
+ </clause>
703
+ </sections>
704
+ <indexsect id='_'>
705
+ <title>Index</title>
706
+ <ul>
707
+ <li>
708
+ <em>Dasein</em>
709
+ , see
710
+ <em>Eman</em>
711
+ cipation, &#xEA;tre
712
+ </li>
713
+ <li>
714
+ &#xE9;long&#xE9;,
715
+ <xref target='_' pagenumber='true'>Clause 1</xref>
716
+ </li>
717
+ <li>
718
+ <em>Eman</em>
719
+ cipation,
720
+ <xref target='_' pagenumber='true'>Clause 1</xref>
721
+ ,
722
+ <xref target='_' pagenumber='true'>1.1</xref>
723
+ <ul>
724
+ <li>
725
+ dans la France,
726
+ <xref target='_' pagenumber='true'>Clause 1</xref>
727
+ <ul>
728
+ <li>
729
+ &#xE0; Paris,
730
+ <xref target='_' pagenumber='true'>1.1</xref>
731
+ </li>
732
+ <li>
733
+ en Bretagne,
734
+ <xref target='_' pagenumber='true'>Clause 1</xref>
735
+ </li>
736
+ </ul>
737
+ </li>
738
+ <li>
739
+ dans les &#xC9;tats-Unis,
740
+ <xref target='_' pagenumber='true'>1.1</xref>
741
+ </li>
742
+ </ul>
743
+ </li>
744
+ <li>
745
+ &#xEA;tre
746
+ <ul>
747
+ <li>
748
+ Husserl, see zebra, see also
749
+ <em>Eman</em>
750
+ cipation, zebra
751
+ <ul>
752
+ <li>
753
+ en allemand,
754
+ <xref target='_' pagenumber='true'>Clause 1</xref>
755
+ </li>
756
+ </ul>
757
+ </li>
758
+ </ul>
759
+ </li>
760
+ <li>
761
+ zebra,
762
+ <xref target='_' pagenumber='true'>1.1</xref>
763
+ </li>
764
+ </ul>
765
+ </indexsect>
766
+ </iso-standard>
774
767
  OUTPUT
775
768
  html = <<~OUTPUT
776
- <html lang='en'>
777
- <head/>
778
- <body lang='en'>
779
- <div class='title-section'>
780
- <p>&#160;</p>
781
- </div>
782
- <br/>
783
- <div class='prefatory-section'>
784
- <p>&#160;</p>
785
- </div>
786
- <br/>
787
- <div class='main-section'>
788
- <p class='zzSTDTitle1'/>
789
- <div id='A'>
790
- <h1>1</h1>
791
- <a id='_'/>
792
- <a id='_'/>
793
- <a id='_'/>
794
- <a id='_'/>
795
- <a id='_'/>
796
- <div id='B'>
797
- <span class='zzMoveToFollowing'>
798
- <b>1.1&#160; </b>
799
- </span>
800
- <a id='_'/>
801
- <a id='_'/>
802
- <a id='_'/>
803
- <a id='_'/>
804
- </div>
805
- </div>
806
- <div id='_'>
807
- <h1>Index</h1>
808
- <ul>
809
- <li>
810
- <i>Dasein</i>
811
- , see
812
- <i>Eman</i>
813
- cipation, &#234;tre
814
- </li>
815
- <li>
816
- &#233;long&#233;,
817
- <a href='#_'>Clause 1</a>
818
- </li>
819
- <li>
820
- <i>Eman</i>
821
- cipation,
822
- <a href='#_'>Clause 1</a>
823
- ,
824
- <a href='#_'>1.1</a>
825
- <ul>
826
- <li>
827
- dans la France,
828
- <a href='#_'>Clause 1</a>
829
- <ul>
830
- <li>
831
- &#224; Paris,
832
- <a href='#_'>1.1</a>
833
- </li>
834
- <li>
835
- en Bretagne,
836
- <a href='#_'>Clause 1</a>
837
- </li>
838
- </ul>
839
- </li>
840
- <li>
841
- dans les &#201;tats-Unis,
842
- <a href='#_'>1.1</a>
843
- </li>
844
- </ul>
845
- </li>
846
- <li>
847
- &#234;tre
848
- <ul>
849
- <li>
850
- Husserl, see zebra, see also
851
- <i>Eman</i>
852
- cipation, zebra
853
- <ul>
854
- <li>
855
- en allemand,
856
- <a href='#_'>Clause 1</a>
857
- </li>
858
- </ul>
859
- </li>
860
- </ul>
861
- </li>
862
- <li>
863
- zebra,
864
- <a href='#_'>1.1</a>
865
- </li>
866
- </ul>
867
- </div>
868
- </div>
869
- </body>
870
- </html>
769
+ <html lang='en'>
770
+ <head/>
771
+ <body lang='en'>
772
+ <div class='title-section'>
773
+ <p>&#160;</p>
774
+ </div>
775
+ <br/>
776
+ <div class='prefatory-section'>
777
+ <p>&#160;</p>
778
+ </div>
779
+ <br/>
780
+ <div class='main-section'>
781
+ <p class='zzSTDTitle1'/>
782
+ <div id='A'>
783
+ <h1>1</h1>
784
+ <a id='_'/>
785
+ <a id='_'/>
786
+ <a id='_'/>
787
+ <a id='_'/>
788
+ <a id='_'/>
789
+ <div id='B'>
790
+ <span class='zzMoveToFollowing'>
791
+ <b>1.1&#160; </b>
792
+ </span>
793
+ <a id='_'/>
794
+ <a id='_'/>
795
+ <a id='_'/>
796
+ <a id='_'/>
797
+ </div>
798
+ </div>
799
+ <div id='_'>
800
+ <h1>Index</h1>
801
+ <ul>
802
+ <li>
803
+ <i>Dasein</i>
804
+ , see
805
+ <i>Eman</i>
806
+ cipation, &#234;tre
807
+ </li>
808
+ <li>
809
+ &#233;long&#233;,
810
+ <a href='#_'>Clause 1</a>
811
+ </li>
812
+ <li>
813
+ <i>Eman</i>
814
+ cipation,
815
+ <a href='#_'>Clause 1</a>
816
+ ,
817
+ <a href='#_'>1.1</a>
818
+ <ul>
819
+ <li>
820
+ dans la France,
821
+ <a href='#_'>Clause 1</a>
822
+ <ul>
823
+ <li>
824
+ &#224; Paris,
825
+ <a href='#_'>1.1</a>
826
+ </li>
827
+ <li>
828
+ en Bretagne,
829
+ <a href='#_'>Clause 1</a>
830
+ </li>
831
+ </ul>
832
+ </li>
833
+ <li>
834
+ dans les &#201;tats-Unis,
835
+ <a href='#_'>1.1</a>
836
+ </li>
837
+ </ul>
838
+ </li>
839
+ <li>
840
+ &#234;tre
841
+ <ul>
842
+ <li>
843
+ Husserl, see zebra, see also
844
+ <i>Eman</i>
845
+ cipation, zebra
846
+ <ul>
847
+ <li>
848
+ en allemand,
849
+ <a href='#_'>Clause 1</a>
850
+ </li>
851
+ </ul>
852
+ </li>
853
+ </ul>
854
+ </li>
855
+ <li>
856
+ zebra,
857
+ <a href='#_'>1.1</a>
858
+ </li>
859
+ </ul>
860
+ </div>
861
+ </div>
862
+ </body>
863
+ </html>
871
864
  OUTPUT
872
- expect(xmlpp(strip_guid(IsoDoc::Iso::PresentationXMLConvert.new({}).convert("test", input, true)
873
- .gsub(%r{<localized-strings>.*</localized-strings>}m, "")))).to be_equivalent_to xmlpp(presxml)
865
+ expect(xmlpp(strip_guid(IsoDoc::Iso::PresentationXMLConvert.new({})
866
+ .convert("test", input, true)
867
+ .gsub(%r{<localized-strings>.*</localized-strings>}m, ""))))
868
+ .to be_equivalent_to xmlpp(presxml)
874
869
  expect(xmlpp(IsoDoc::Iso::HtmlConvert.new({})
875
870
  .convert("test", presxml, true))).to be_equivalent_to xmlpp(html)
876
871
  end