metanorma-iso 1.3.21 → 1.3.26

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 (64) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/macos.yml +8 -7
  3. data/.github/workflows/ubuntu.yml +8 -7
  4. data/.github/workflows/windows.yml +8 -8
  5. data/Gemfile +2 -0
  6. data/lib/asciidoctor/iso/base.rb +22 -0
  7. data/lib/asciidoctor/iso/biblio.rng +142 -37
  8. data/lib/asciidoctor/iso/cleanup.rb +19 -2
  9. data/lib/asciidoctor/iso/front.rb +19 -72
  10. data/lib/asciidoctor/iso/front_id.rb +196 -0
  11. data/lib/asciidoctor/iso/isodoc.rng +48 -2
  12. data/lib/asciidoctor/iso/isostandard-amd.rng +98 -0
  13. data/lib/asciidoctor/iso/isostandard.rng +17 -1
  14. data/lib/asciidoctor/iso/macros.rb +21 -0
  15. data/lib/asciidoctor/iso/section.rb +18 -32
  16. data/lib/asciidoctor/iso/term_lookup_cleanup.rb +87 -0
  17. data/lib/asciidoctor/iso/validate.rb +41 -21
  18. data/lib/asciidoctor/iso/validate_requirements.rb +1 -1
  19. data/lib/asciidoctor/iso/validate_section.rb +2 -2
  20. data/lib/asciidoctor/iso/validate_style.rb +7 -6
  21. data/lib/isodoc/iso/base_convert.rb +48 -64
  22. data/lib/isodoc/iso/html/header.html +10 -6
  23. data/lib/isodoc/iso/html/html_iso_titlepage.html +27 -18
  24. data/lib/isodoc/iso/html/isodoc.scss +49 -28
  25. data/lib/isodoc/iso/html/scripts.html +23 -21
  26. data/lib/isodoc/iso/html/style-human.scss +25 -2
  27. data/lib/isodoc/iso/html/style-iso.scss +20 -2
  28. data/lib/isodoc/iso/html/word_iso_titlepage.html +23 -2
  29. data/lib/isodoc/iso/html/wordstyle.scss +80 -39
  30. data/lib/isodoc/iso/html_convert.rb +7 -9
  31. data/lib/isodoc/iso/iso.amendment.xsl +4597 -0
  32. data/lib/isodoc/iso/iso.international-standard.xsl +4597 -0
  33. data/lib/isodoc/iso/metadata.rb +74 -44
  34. data/lib/isodoc/iso/pdf_convert.rb +39 -0
  35. data/lib/isodoc/iso/sections.rb +66 -0
  36. data/lib/isodoc/iso/sts_convert.rb +29 -0
  37. data/lib/metanorma-iso.rb +2 -0
  38. data/lib/metanorma/iso/processor.rb +16 -1
  39. data/lib/metanorma/iso/version.rb +1 -1
  40. data/metanorma-iso.gemspec +4 -1
  41. data/spec/asciidoctor-iso/amd_spec.rb +726 -0
  42. data/spec/asciidoctor-iso/base_spec.rb +43 -21
  43. data/spec/asciidoctor-iso/blocks_spec.rb +21 -9
  44. data/spec/asciidoctor-iso/cleanup_spec.rb +203 -175
  45. data/spec/asciidoctor-iso/inline_spec.rb +2 -1
  46. data/spec/asciidoctor-iso/macros_spec.rb +275 -0
  47. data/spec/asciidoctor-iso/refs_spec.rb +7 -4
  48. data/spec/asciidoctor-iso/section_spec.rb +8 -8
  49. data/spec/assets/iso.xml +64 -1
  50. data/spec/isodoc/amd_spec.rb +606 -0
  51. data/spec/isodoc/i18n_spec.rb +12 -20
  52. data/spec/isodoc/inline_spec.rb +2 -2
  53. data/spec/isodoc/iso_spec.rb +1 -1
  54. data/spec/isodoc/metadata_spec.rb +12 -4
  55. data/spec/isodoc/postproc_spec.rb +20 -119
  56. data/spec/isodoc/ref_spec.rb +5 -5
  57. data/spec/isodoc/section_spec.rb +36 -13
  58. data/spec/isodoc/table_spec.rb +22 -22
  59. data/spec/isodoc/terms_spec.rb +2 -2
  60. data/spec/isodoc/xref_spec.rb +19 -19
  61. data/spec/metanorma/processor_spec.rb +2 -2
  62. data/spec/spec_helper.rb +13 -1
  63. metadata +57 -5
  64. data/asciidoctor-iso.gemspec.old +0 -50
@@ -0,0 +1,606 @@
1
+ require "spec_helper"
2
+
3
+ RSpec.describe IsoDoc do
4
+ it "cross-references notes in amendments" do
5
+ expect(xmlpp(IsoDoc::Iso::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
6
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
7
+ <bibdata> <ext> <doctype>amendment</doctype> </ext> </bibdata>
8
+ <preface>
9
+ <foreword>
10
+ <p>
11
+ <xref target="N"/>
12
+ <xref target="note1"/>
13
+ <xref target="note2"/>
14
+ <xref target="AN"/>
15
+ <xref target="Anote1"/>
16
+ <xref target="Anote2"/>
17
+ </p>
18
+ </foreword>
19
+ </preface>
20
+ <sections>
21
+ <clause id="scope"><title>Scope</title>
22
+ <note id="N">
23
+ <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p>
24
+ </note>
25
+ <p><xref target="N"/></p>
26
+
27
+ </clause>
28
+ <terms id="terms"/>
29
+ <clause id="widgets"><title>Widgets</title>
30
+ <clause id="widgets1">
31
+ <note id="note1">
32
+ <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p>
33
+ </note>
34
+ <note id="note2">
35
+ <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83a">These results are based on a study carried out on three different types of kernel.</p>
36
+ </note>
37
+ <p> <xref target="note1"/> <xref target="note2"/> </p>
38
+
39
+ </clause>
40
+ </clause>
41
+ </sections>
42
+ <annex id="annex1">
43
+ <clause id="annex1a">
44
+ <note id="AN">
45
+ <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p>
46
+ </note>
47
+ </clause>
48
+ <clause id="annex1b">
49
+ <note id="Anote1">
50
+ <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p>
51
+ </note>
52
+ <note id="Anote2">
53
+ <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83a">These results are based on a study carried out on three different types of kernel.</p>
54
+ </note>
55
+ </clause>
56
+ </annex>
57
+ </iso-standard>
58
+ INPUT
59
+ #{HTML_HDR}
60
+ <br/>
61
+ <div>
62
+ <h1 class="ForewordTitle">Foreword</h1>
63
+ <p>
64
+ <a href="#N">[N]</a>
65
+ <a href="#note1">[note1]</a>
66
+ <a href="#note2">[note2]</a>
67
+ <a href="#AN">A.1, Note</a>
68
+ <a href="#Anote1">A.2, Note 1</a>
69
+ <a href="#Anote2">A.2, Note 2</a>
70
+ </p>
71
+ </div>
72
+ <p class="zzSTDTitle1"/>
73
+ <div id="scope">
74
+ <h1>Scope</h1>
75
+ <div id="N" class="Note">
76
+ <p><span class="note_label">NOTE</span>&#160; These results are based on a study carried out on three different types of kernel.</p>
77
+ </div>
78
+ <p>
79
+ <a href="#N">[n]</a>
80
+ </p>
81
+ </div>
82
+ <div id="terms"><h1/>
83
+ </div>
84
+ <div id="widgets">
85
+ <h1>Widgets</h1>
86
+ <div id="widgets1"><span class='zzMoveToFollowing'><b/></span>
87
+ <div id="note1" class="Note"><p><span class="note_label">NOTE</span>&#160; These results are based on a study carried out on three different types of kernel.</p></div>
88
+ <div id="note2" class="Note"><p><span class="note_label">NOTE</span>&#160; These results are based on a study carried out on three different types of kernel.</p></div>
89
+ <p> <a href="#note1">[note1]</a> <a href="#note2">[note2]</a> </p>
90
+
91
+ </div>
92
+ </div>
93
+ <br/>
94
+ <div id="annex1" class="Section3">
95
+ <h1 class='Annex'>
96
+ <b>Annex A</b>
97
+ <br/>
98
+ (informative)
99
+ <br/>
100
+ <br/>
101
+ <b/>
102
+ </h1>
103
+ <div id="annex1a"><span class='zzMoveToFollowing'><b>A.1&#160; </b></span>
104
+ <div id="AN" class="Note"><p><span class="note_label">NOTE</span>&#160; These results are based on a study carried out on three different types of kernel.</p></div>
105
+ </div>
106
+ <div id="annex1b"><span class='zzMoveToFollowing'><b>A.2&#160; </b></span>
107
+ <div id="Anote1" class="Note"><p><span class="note_label">NOTE 1</span>&#160; These results are based on a study carried out on three different types of kernel.</p></div>
108
+ <div id="Anote2" class="Note"><p><span class="note_label">NOTE 2</span>&#160; These results are based on a study carried out on three different types of kernel.</p></div>
109
+ </div>
110
+ </div>
111
+ </div>
112
+ </body>
113
+ </html>
114
+ OUTPUT
115
+ end
116
+
117
+ it "cross-references sections" do
118
+ expect(xmlpp(IsoDoc::Iso::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
119
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
120
+ <bibdata> <ext> <doctype>amendment</doctype> </ext> </bibdata>
121
+ <preface>
122
+ <foreword obligation="informative">
123
+ <title>Foreword</title>
124
+ <p id="A">This is a preamble
125
+ <xref target="C"/>
126
+ <xref target="C1"/>
127
+ <xref target="D"/>
128
+ <xref target="H"/>
129
+ <xref target="I"/>
130
+ <xref target="J"/>
131
+ <xref target="K"/>
132
+ <xref target="L"/>
133
+ <xref target="M"/>
134
+ <xref target="N"/>
135
+ <xref target="O"/>
136
+ <xref target="P"/>
137
+ <xref target="Q"/>
138
+ <xref target="Q1"/>
139
+ <xref target="Q2"/>
140
+ <xref target="R"/>
141
+ </p>
142
+ </foreword>
143
+ <introduction id="B" obligation="informative"><title>Introduction</title><clause id="C" inline-header="false" obligation="informative">
144
+ <title>Introduction Subsection</title>
145
+ </clause>
146
+ <clause id="C1" inline-header="false" obligation="informative">Text</clause>
147
+ </introduction></preface><sections>
148
+ <clause id="D" obligation="normative">
149
+ <title>Scope</title>
150
+ <p id="E">Text</p>
151
+ </clause>
152
+
153
+ <clause id="M" inline-header="false" obligation="normative"><title>Clause 4</title><clause id="N" inline-header="false" obligation="normative">
154
+ <title>Introduction</title>
155
+ </clause>
156
+ <clause id="O" inline-header="false" obligation="normative">
157
+ <title>Clause 4.2</title>
158
+ </clause></clause>
159
+
160
+ </sections><annex id="P" inline-header="false" obligation="normative">
161
+ <title>Annex</title>
162
+ <clause id="Q" inline-header="false" obligation="normative">
163
+ <title>Annex A.1</title>
164
+ <clause id="Q1" inline-header="false" obligation="normative">
165
+ <title>Annex A.1a</title>
166
+ </clause>
167
+ </clause>
168
+ <appendix id="Q2" inline-header="false" obligation="normative">
169
+ <title>An Appendix</title>
170
+ </appendix>
171
+ </annex><bibliography><references id="R" obligation="informative" normative="true">
172
+ <title>Normative References</title>
173
+ </references><clause id="S" obligation="informative">
174
+ <title>Bibliography</title>
175
+ <references id="T" obligation="informative" normative="false">
176
+ <title>Bibliography Subsection</title>
177
+ </references>
178
+ </clause>
179
+ </bibliography>
180
+ </iso-standard>
181
+ INPUT
182
+ #{HTML_HDR}
183
+ <br/>
184
+ <div>
185
+ <h1 class="ForewordTitle">Foreword</h1>
186
+ <p id="A">This is a preamble
187
+ <a href='#C'>[C]</a>
188
+ <a href='#C1'>[C1]</a>
189
+ <a href='#D'>[D]</a>
190
+ <a href='#H'>[H]</a>
191
+ <a href='#I'>[I]</a>
192
+ <a href='#J'>[J]</a>
193
+ <a href='#K'>[K]</a>
194
+ <a href='#L'>[L]</a>
195
+ <a href='#M'>[M]</a>
196
+ <a href='#N'>[N]</a>
197
+ <a href='#O'>[O]</a>
198
+ <a href='#P'>Annex A</a>
199
+ <a href='#Q'>A.1</a>
200
+ <a href='#Q1'>A.1.1</a>
201
+ <a href='#Q2'>Annex A, Appendix 1</a>
202
+ <a href='#R'>[R]</a>
203
+ </p>
204
+ </div>
205
+ <br/>
206
+ <div class="Section3" id="B">
207
+ <h1 class="IntroTitle">Introduction</h1>
208
+ <div id="C">
209
+ <h1>Introduction Subsection</h1>
210
+ </div>
211
+ <div id="C1"><span class='zzMoveToFollowing'>
212
+ <b/>
213
+ </span>
214
+ Text</div>
215
+ </div>
216
+ <p class="zzSTDTitle1"/>
217
+ <div id="D">
218
+ <h1>Scope</h1>
219
+ <p id="E">Text</p>
220
+ </div>
221
+ <div>
222
+ <h1>Normative references</h1>
223
+ </div>
224
+ <div id="M">
225
+ <h1>Clause 4</h1>
226
+ <div id="N">
227
+ <h1>Introduction</h1>
228
+ </div>
229
+ <div id="O">
230
+ <h1>Clause 4.2</h1>
231
+ </div>
232
+ </div>
233
+ <br/>
234
+ <div id="P" class="Section3">
235
+ <h1 class="Annex"><b>Annex A</b><br/>(normative)<br/><br/><b>Annex</b></h1>
236
+ <div id="Q">
237
+ <h2>A.1&#160; Annex A.1</h2>
238
+ <div id="Q1">
239
+ <h3>A.1.1&#160; Annex A.1a</h3>
240
+ </div>
241
+ </div>
242
+ <div id="Q2">
243
+ <h2>Appendix 1&#160; An Appendix</h2>
244
+ </div>
245
+ </div>
246
+ <br/>
247
+ <div>
248
+ <h1 class="Section3">Bibliography</h1>
249
+ <div>
250
+ <h2 class="Section3">Bibliography Subsection</h2>
251
+ </div>
252
+ </div>
253
+ </div>
254
+ </body>
255
+ </html>
256
+ OUTPUT
257
+ end
258
+
259
+ it "processes section names" do
260
+ expect(xmlpp(IsoDoc::Iso::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
261
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
262
+ <bibdata> <ext> <doctype>amendment</doctype> </ext> </bibdata>
263
+ <boilerplate>
264
+ <copyright-statement>
265
+ <clause>
266
+ <title>Copyright</title>
267
+ </clause>
268
+ </copyright-statement>
269
+ <license-statement>
270
+ <clause>
271
+ <title>License</title>
272
+ </clause>
273
+ </license-statement>
274
+ <legal-statement>
275
+ <clause>
276
+ <title>Legal</title>
277
+ </clause>
278
+ </legal-statement>
279
+ <feedback-statement>
280
+ <clause>
281
+ <title>Feedback</title>
282
+ </clause>
283
+ </feedback-statement>
284
+ </boilerplate>
285
+ <preface>
286
+ <abstract obligation="informative">
287
+ <title>Foreword</title>
288
+ </abstract>
289
+ <foreword obligation="informative">
290
+ <title>Foreword</title>
291
+ <p id="A">This is a preamble</p>
292
+ </foreword>
293
+ <introduction id="B" obligation="informative"><title>Introduction</title><clause id="C" inline-header="false" obligation="informative">
294
+ <title>Introduction Subsection</title>
295
+ </clause>
296
+ </introduction>
297
+ <clause id="B1"><title>Dedication</title></clause>
298
+ <clause id="B2"><title>Note to reader</title></clause>
299
+ <acknowledgements obligation="informative">
300
+ <title>Acknowledgements</title>
301
+ </acknowledgements>
302
+ </preface><sections>
303
+ <clause id="D" obligation="normative">
304
+ <title>Scope</title>
305
+ <p id="E">Text</p>
306
+ </clause>
307
+
308
+ <clause id="M" inline-header="false" obligation="normative"><title>Clause 4</title><clause id="N" inline-header="false" obligation="normative">
309
+ <title>Introduction</title>
310
+ </clause>
311
+ <clause id="O" inline-header="false" obligation="normative">
312
+ <title>Clause 4.2</title>
313
+ </clause>
314
+ <clause id="O1" inline-header="false" obligation="normative">
315
+ </clause>
316
+ </clause>
317
+
318
+ </sections><annex id="P" inline-header="false" obligation="normative">
319
+ <title>Annex</title>
320
+ <clause id="Q" inline-header="false" obligation="normative">
321
+ <title>Annex A.1</title>
322
+ <clause id="Q1" inline-header="false" obligation="normative">
323
+ <title>Annex A.1a</title>
324
+ </clause>
325
+ <references id="Q2" normative="false"><title>Annex Bibliography</title></references>
326
+ </clause>
327
+ </annex>
328
+ <annex id="P1" inline-header="false" obligation="normative">
329
+ </annex>
330
+ <bibliography><references id="R" obligation="informative" normative="true">
331
+ <title>Normative References</title>
332
+ </references><clause id="S" obligation="informative">
333
+ <title>Bibliography</title>
334
+ <references id="T" obligation="informative" normative="false">
335
+ <title>Bibliography Subsection</title>
336
+ </references>
337
+ </clause>
338
+ </bibliography>
339
+ </iso-standard>
340
+ INPUT
341
+ <html xmlns:epub='http://www.idpf.org/2007/ops' lang='en'>
342
+ <head/>
343
+ <body lang='en'>
344
+ <div class='title-section'>
345
+ <p>&#160;</p>
346
+ </div>
347
+ <br/>
348
+ <div class='prefatory-section'>
349
+ <p>&#160;</p>
350
+ </div>
351
+ <br/>
352
+ <div class='main-section'>
353
+ <div class='authority'>
354
+ <div class='boilerplate-copyright'>
355
+ <div>
356
+ <h1>Copyright</h1>
357
+ </div>
358
+ </div>
359
+ <div class='boilerplate-license'>
360
+ <div>
361
+ <h1>License</h1>
362
+ </div>
363
+ </div>
364
+ <div class='boilerplate-legal'>
365
+ <div>
366
+ <h1>Legal</h1>
367
+ </div>
368
+ </div>
369
+ <div class='boilerplate-feedback'>
370
+ <div>
371
+ <h1>Feedback</h1>
372
+ </div>
373
+ </div>
374
+ </div>
375
+ <br/>
376
+ <div>
377
+ <h1 class='AbstractTitle'>Abstract</h1>
378
+ </div>
379
+ <br/>
380
+ <div>
381
+ <h1 class='ForewordTitle'>Foreword</h1>
382
+ <p id='A'>This is a preamble</p>
383
+ </div>
384
+ <br/>
385
+ <div class='Section3' id='B'>
386
+ <h1 class='IntroTitle'>Introduction</h1>
387
+ <div id='C'>
388
+ <h1>Introduction Subsection</h1>
389
+ </div>
390
+ </div>
391
+ <br/>
392
+ <div class='Section3' id='B1'>
393
+ <h1 class='IntroTitle'>Dedication</h1>
394
+ </div>
395
+ <br/>
396
+ <div class='Section3' id='B2'>
397
+ <h1 class='IntroTitle'>Note to reader</h1>
398
+ </div>
399
+ <br/>
400
+ <div class='Section3' id=''>
401
+ <h1 class='IntroTitle'>Acknowledgements</h1>
402
+ </div>
403
+ <p class='zzSTDTitle1'/>
404
+ <div id='D'>
405
+ <h1>Scope</h1>
406
+ <p id='E'>Text</p>
407
+ </div>
408
+ <div>
409
+ <h1>Normative references</h1>
410
+ </div>
411
+ <div id='M'>
412
+ <h1>Clause 4</h1>
413
+ <div id='N'>
414
+ <h1>Introduction</h1>
415
+ </div>
416
+ <div id='O'>
417
+ <h1>Clause 4.2</h1>
418
+ </div>
419
+ <div id='O1'>
420
+ <span class='zzMoveToFollowing'>
421
+ <b/>
422
+ </span>
423
+ </div>
424
+ </div>
425
+ <br/>
426
+ <div id='P' class='Section3'>
427
+ <h1 class='Annex'>
428
+ <b>Annex A</b>
429
+ <br/>
430
+ (normative)
431
+ <br/>
432
+ <br/>
433
+ <b>Annex</b>
434
+ </h1>
435
+ <div id='Q'>
436
+ <h2>A.1&#160; Annex A.1</h2>
437
+ <div id='Q1'>
438
+ <h3>A.1.1&#160; Annex A.1a</h3>
439
+ </div>
440
+ <div>
441
+ <h3>A.1.2&#160; Annex Bibliography</h3>
442
+ </div>
443
+ </div>
444
+ </div>
445
+ <br/>
446
+ <div id='P1' class='Section3'>
447
+ <h1 class='Annex'>
448
+ <b>Annex B</b>
449
+ <br/>
450
+ (normative)
451
+ <br/>
452
+ <br/>
453
+ <b/>
454
+ </h1>
455
+ </div>
456
+ <br/>
457
+ <div>
458
+ <h1 class='Section3'>Bibliography</h1>
459
+ <div>
460
+ <h2 class='Section3'>Bibliography Subsection</h2>
461
+ </div>
462
+ </div>
463
+ </div>
464
+ </body>
465
+ </html>
466
+ OUTPUT
467
+ end
468
+
469
+ it "processes IsoXML metadata" do
470
+ c = IsoDoc::Iso::HtmlConvert.new({})
471
+ arr = c.convert_init(<<~"INPUT", "test", false)
472
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
473
+ INPUT
474
+ expect(Hash[c.info(Nokogiri::XML(<<~"INPUT"), nil).sort]).to be_equivalent_to <<~"OUTPUT"
475
+ <iso-standard xmlns='https://www.metanorma.org/ns/iso'>
476
+ <bibdata type='standard'>
477
+ <title language='en' format='text/plain' type='main'>Introduction — Main Title — Title — Title Part  — Mass fraction of
478
+ extraneous matter, milled rice (nonglutinous), sample dividers and
479
+ recommendations relating to storage and transport conditions</title>
480
+ <title language='en' format='text/plain' type='title-intro'>Introduction</title>
481
+ <title language='en' format='text/plain' type='title-main'>Main Title — Title</title>
482
+ <title language='en' format='text/plain' type='title-part'>Title Part</title>
483
+ <title language='en' format='text/plain' type='title-amd'>Mass fraction of extraneous matter, milled rice (nonglutinous), sample dividers and recommendations relating to storage and transport conditions</title>
484
+ <title language='fr' format='text/plain' type='main'>
485
+ Introduction Française — Titre Principal — Part du Titre — Fraction
486
+ massique de matière étrangère, riz usiné (non gluant), diviseurs
487
+ d’échantillon et recommandations relatives aux conditions d’entreposage et
488
+ de transport
489
+ </title>
490
+ <title language='fr' format='text/plain' type='title-intro'>Introduction Française</title>
491
+ <title language='fr' format='text/plain' type='title-main'>Titre Principal</title>
492
+ <title language='fr' format='text/plain' type='title-part'>Part du Titre</title>
493
+ <title language='fr' format='text/plain' type='title-amd'>Fraction massique de matière étrangère, riz usiné (non gluant), diviseurs d’échantillon et recommandations relatives aux conditions d’entreposage et de transport</title>
494
+ <docidentifier type='iso'>ISO/PreNWIP3 17301-1:2016/Amd.1</docidentifier>
495
+ <docidentifier type='iso-with-lang'>ISO/PreNWIP3 17301-1:2016/Amd.1(E)</docidentifier>
496
+ <docidentifier type='iso-reference'>ISO/PreNWIP3 17301-1:2016/Amd.1:2017(E)</docidentifier>
497
+ <docnumber>17301</docnumber>
498
+ <date type='created'>
499
+ <on>2016-05-01</on>
500
+ </date>
501
+ <contributor>
502
+ <role type='author'/>
503
+ <organization>
504
+ <name>International Organization for Standardization</name>
505
+ <abbreviation>ISO</abbreviation>
506
+ </organization>
507
+ </contributor>
508
+ <contributor>
509
+ <role type='publisher'/>
510
+ <organization>
511
+ <name>International Organization for Standardization</name>
512
+ <abbreviation>ISO</abbreviation>
513
+ </organization>
514
+ </contributor>
515
+ <edition>2</edition>
516
+ <version>
517
+ <revision-date>2000-01-01</revision-date>
518
+ <draft>0.3.4</draft>
519
+ </version>
520
+ <language>en</language>
521
+ <script>Latn</script>
522
+ <status>
523
+ <stage abbreviation='NWIP'>10</stage>
524
+ <substage>20</substage>
525
+ <iteration>3</iteration>
526
+ </status>
527
+ <copyright>
528
+ <from>2017</from>
529
+ <owner>
530
+ <organization>
531
+ <name>International Organization for Standardization</name>
532
+ <abbreviation>ISO</abbreviation>
533
+ </organization>
534
+ </owner>
535
+ </copyright>
536
+ <ext>
537
+ <doctype>amendment</doctype>
538
+ <editorialgroup>
539
+ <technical-committee number='1' type='A'>TC</technical-committee>
540
+ <technical-committee number='11' type='A1'>TC1</technical-committee>
541
+ <subcommittee number='2' type='B'>SC</subcommittee>
542
+ <subcommittee number='21' type='B1'>SC1</subcommittee>
543
+ <workgroup number='3' type='C'>WG</workgroup>
544
+ <workgroup number='31' type='C1'>WG1</workgroup>
545
+ <secretariat>SECRETARIAT</secretariat>
546
+ </editorialgroup>
547
+ <ics>
548
+ <code>1</code>
549
+ </ics>
550
+ <ics>
551
+ <code>2</code>
552
+ </ics>
553
+ <ics>
554
+ <code>3</code>
555
+ </ics>
556
+ <structuredidentifier>
557
+ <project-number part='1' amendment='1' corrigendum='2' origyr='2016-05-01'>17301</project-number>
558
+ </structuredidentifier>
559
+ <stagename>New work item proposal</stagename>
560
+ <updates-document-type>international-standard</updates-document-type>
561
+ </ext>
562
+ </bibdata>
563
+ <sections/>
564
+ </iso-standard>
565
+ INPUT
566
+ {:agency=>"ISO", :authors=>[], :authors_affiliations=>{}, :createddate=>"2016-05-01", :docnumber=>"ISO/PreNWIP3 17301-1:2016/Amd.1", :docnumber_lang=>"ISO/PreNWIP3 17301-1:2016/Amd.1(E)", :docnumber_reference=>"ISO/PreNWIP3 17301-1:2016/Amd.1:2017(E)", :docnumeric=>"17301", :docsubtitle=>"Introduction Fran&#xe7;aise&nbsp;&mdash; Titre Principal&nbsp;&mdash; Partie&nbsp;1: Part du Titre", :docsubtitleamd=>"Fraction massique de mati&#xe8;re &#xe9;trang&#xe8;re, riz usin&#xe9; (non gluant), diviseurs d&#x2019;&#xe9;chantillon et recommandations relatives aux conditions d&#x2019;entreposage et de transport", :docsubtitleamdlabel=>"AMENDMENT&nbsp;1", :docsubtitlecorrlabel=>"RECTIFICATIF TECHNIQUE&nbsp;2", :docsubtitleintro=>"Introduction Fran&#xe7;aise", :docsubtitlemain=>"Titre Principal", :docsubtitlepart=>"Part du Titre", :docsubtitlepartlabel=>"Partie&nbsp;1", :doctitle=>"Introduction&nbsp;&mdash; Main Title&#x2009;&#x2014;&#x2009;Title&nbsp;&mdash; Part&nbsp;1: Title Part", :doctitleamd=>"Mass fraction of extraneous matter, milled rice (nonglutinous), sample dividers and recommendations relating to storage and transport conditions", :doctitleamdlabel=>"AMENDMENT&nbsp;1", :doctitlecorrlabel=>"TECHNICAL CORRIGENDUM&nbsp;2", :doctitleintro=>"Introduction", :doctitlemain=>"Main Title&#x2009;&#x2014;&#x2009;Title", :doctitlepart=>"Title Part", :doctitlepartlabel=>"Part&nbsp;1", :doctype=>"Amendment", :docyear=>"2017", :draft=>"0.3.4", :draftinfo=>" (draft 0.3.4, 2000-01-01)", :edition=>"2", :editorialgroup=>["A 1", "B 2", "C 3"], :ics=>"1, 2, 3", :keywords=>[], :obsoletes=>nil, :obsoletes_part=>nil, :publisher=>"International Organization for Standardization", :revdate=>"2000-01-01", :revdate_monthyear=>"January 2000", :sc=>"B 2", :secretariat=>"SECRETARIAT", :stage=>"10", :stage_int=>10, :stageabbr=>"NWIP", :statusabbr=>"PreNWIP3", :tc=>"A 1", :tc_docnumber=>[], :unpublished=>true, :wg=>"C 3"}
567
+ OUTPUT
568
+ end
569
+
570
+ it "processes middle title" do
571
+ expect(xmlpp(IsoDoc::Iso::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
572
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
573
+ <bibdata>
574
+ <title language='en' format='text/plain' type='title-intro'>Introduction</title>
575
+ <title language='en' format='text/plain' type='title-main'>Main Title — Title</title>
576
+ <title language='en' format='text/plain' type='title-part'>Title Part</title>
577
+ <title language='en' format='text/plain' type='title-amd'>Mass fraction of extraneous matter, milled rice (nonglutinous), sample dividers and recommendations relating to storage and transport conditions</title>
578
+ <ext>
579
+ <structuredidentifier>
580
+ <project-number part='1' amendment='1' corrigendum='2' origyr='2016-05-01'>17301</project-number>
581
+ </structuredidentifier>
582
+ </ext>
583
+ </bibdata>
584
+ <sections/>
585
+ </iso-standard>
586
+ INPUT
587
+ #{HTML_HDR}
588
+ <p class='zzSTDTitle1'>Introduction &#8212; Main Title&#8201;&#8212;&#8201;Title &#8212; </p>
589
+ <p class='zzSTDTitle2'>
590
+ Part&#160;1:
591
+ <br/><b>Title Part</b>
592
+ </p>
593
+ <p class='zzSTDTitle2'>
594
+ AMENDMENT&#160;1: Mass fraction of extraneous matter, milled rice
595
+ (nonglutinous), sample dividers and recommendations relating to storage
596
+ and transport conditions
597
+ </p>
598
+ <p class='zzSTDTitle2'>TECHNICAL CORRIGENDUM&#160;2</p>
599
+ </div>
600
+ </body>
601
+ </html>
602
+ OUTPUT
603
+ end
604
+
605
+
606
+ end