metanorma-iec 1.3.13 → 1.4.3
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.
- checksums.yaml +4 -4
- data/Rakefile +1 -1
- data/lib/asciidoctor/iec/converter.rb +42 -25
- data/lib/asciidoctor/iec/front.rb +2 -3
- data/lib/asciidoctor/iec/isodoc.rng +254 -27
- data/lib/isodoc/iec/base_convert.rb +2 -35
- data/lib/isodoc/iec/html/htmlstyle.css +3 -1
- data/lib/isodoc/iec/html/htmlstyle.scss +4 -1
- data/lib/isodoc/iec/html/isodoc.css +1 -2
- data/lib/isodoc/iec/html/isodoc.scss +1 -2
- data/lib/isodoc/iec/iec.international-standard.xsl +58 -20
- data/lib/isodoc/iec/presentation_xml_convert.rb +32 -5
- data/lib/isodoc/iec/word_convert.rb +1 -1
- data/lib/metanorma/iec/processor.rb +15 -8
- data/lib/metanorma/iec/version.rb +1 -1
- data/metanorma-iec.gemspec +3 -3
- data/spec/asciidoctor/base_spec.rb +0 -6
- data/spec/asciidoctor/blocks_spec.rb +2 -75
- data/spec/asciidoctor/cleanup_spec.rb +231 -322
- data/spec/asciidoctor/iev_spec.rb +195 -190
- data/spec/asciidoctor/inline_spec.rb +0 -45
- data/spec/asciidoctor/section_spec.rb +4 -4
- data/spec/isodoc/iev_spec.rb +136 -28
- data/spec/isodoc/terms_spec.rb +190 -181
- data/spec/metanorma/processor_spec.rb +139 -44
- data/spec/spec_helper.rb +10 -12
- metadata +8 -8
@@ -1,12 +1,12 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
|
3
3
|
RSpec.describe Asciidoctor::Iec do
|
4
|
-
|
5
|
-
|
6
|
-
end
|
4
|
+
before(:all) do
|
5
|
+
@blank_hdr = blank_hdr_gen
|
6
|
+
end
|
7
7
|
|
8
8
|
it "moves note from TC/SC officers to metadata" do
|
9
|
-
|
9
|
+
input = <<~INPUT
|
10
10
|
#{ASCIIDOC_BLANK_HDR}
|
11
11
|
== {blank}
|
12
12
|
|
@@ -19,173 +19,90 @@ end
|
|
19
19
|
This document is also of interest for ISO/ TC114/ WG1 Requirements for Watch batteries
|
20
20
|
====
|
21
21
|
INPUT
|
22
|
-
|
23
|
-
<
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
</tc-sc-officers-note>
|
72
|
-
|
73
|
-
</bibdata>
|
74
|
-
#{boilerplate(Nokogiri::XML(BLANK_HDR +
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
22
|
+
output = <<~OUTPUT
|
23
|
+
<iec-standard xmlns="https://www.metanorma.org/ns/iec" type="semantic" version="#{Metanorma::Iec::VERSION}">
|
24
|
+
<bibdata type="standard">
|
25
|
+
<contributor>
|
26
|
+
<role type="author"/>
|
27
|
+
<organization>
|
28
|
+
<name>International Electrotechnical Commission</name>
|
29
|
+
<abbreviation>IEC</abbreviation>
|
30
|
+
</organization>
|
31
|
+
</contributor>
|
32
|
+
<contributor>
|
33
|
+
<role type="publisher"/>
|
34
|
+
<organization>
|
35
|
+
<name>International Electrotechnical Commission</name>
|
36
|
+
<abbreviation>IEC</abbreviation>
|
37
|
+
</organization>
|
38
|
+
</contributor>
|
39
|
+
<language>en</language>
|
40
|
+
<script>Latn</script>
|
41
|
+
<status>
|
42
|
+
<stage abbreviation="PPUB">60</stage>
|
43
|
+
<substage abbreviation="PPUB">60</substage>
|
44
|
+
</status>
|
45
|
+
<copyright>
|
46
|
+
<from>#{Time.new.year}</from>
|
47
|
+
<owner>
|
48
|
+
<organization>
|
49
|
+
<name>International Electrotechnical Commission</name>
|
50
|
+
<abbreviation>IEC</abbreviation>
|
51
|
+
</organization>
|
52
|
+
</owner>
|
53
|
+
</copyright>
|
54
|
+
<ext>
|
55
|
+
<doctype>article</doctype>
|
56
|
+
<editorialgroup>
|
57
|
+
<technical-committee/>
|
58
|
+
<subcommittee/>
|
59
|
+
<workgroup/>
|
60
|
+
</editorialgroup>
|
61
|
+
<stagename>International standard</stagename>
|
62
|
+
<tc-sc-officers-note>
|
63
|
+
<p id='_'>
|
64
|
+
This FDIS is the result of the discussion between the IEC SC21A
|
65
|
+
experts WG 3 during the meeting held in Chicago (USA) on April 9th
|
66
|
+
</p>
|
67
|
+
<p id='_'>
|
68
|
+
This document is also of interest for ISO/ TC114/ WG1 Requirements for
|
69
|
+
Watch batteries
|
70
|
+
</p>
|
71
|
+
</tc-sc-officers-note>
|
72
|
+
</ext>
|
73
|
+
</bibdata>
|
74
|
+
#{boilerplate(Nokogiri::XML(BLANK_HDR + '</iec-standard>'))}
|
75
|
+
<sections>
|
76
|
+
<clause id="_" inline-header="false" obligation="normative">
|
77
|
+
|
78
|
+
</clause>
|
79
|
+
</sections>
|
80
|
+
</iec-standard>
|
81
81
|
OUTPUT
|
82
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
83
|
+
.to be_equivalent_to xmlpp(output)
|
82
84
|
end
|
83
85
|
|
84
86
|
it "removes empty text elements" do
|
85
|
-
|
87
|
+
input = <<~INPUT
|
86
88
|
#{ASCIIDOC_BLANK_HDR}
|
87
89
|
== {blank}
|
88
90
|
INPUT
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
</clause>
|
94
|
-
</sections>
|
95
|
-
</iec-standard>
|
96
|
-
OUTPUT
|
97
|
-
end
|
98
|
-
|
99
|
-
it "processes stem-only terms as admitted" do
|
100
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
101
|
-
#{ASCIIDOC_BLANK_HDR}
|
102
|
-
== Terms and Definitions
|
103
|
-
|
104
|
-
=== stem:[t_90]
|
105
|
-
|
106
|
-
stem:[t_91]
|
107
|
-
|
108
|
-
Time
|
109
|
-
INPUT
|
110
|
-
#{@blank_hdr}
|
111
|
-
<sections>
|
112
|
-
<terms id="_" obligation="normative">
|
113
|
-
<title>Terms and definitions</title>
|
114
|
-
<p id="_">For the purposes of this document,
|
115
|
-
the following terms and definitions apply.</p>
|
116
|
-
#{TERMS_BOILERPLATE}
|
117
|
-
<term id="term-t90"><preferred><stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mrow>
|
118
|
-
<mi>t</mi>
|
119
|
-
</mrow>
|
120
|
-
<mrow>
|
121
|
-
<mn>90</mn>
|
122
|
-
</mrow>
|
123
|
-
</msub></math></stem></preferred><admitted><stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mrow>
|
124
|
-
<mi>t</mi>
|
125
|
-
</mrow>
|
126
|
-
<mrow>
|
127
|
-
<mn>91</mn>
|
128
|
-
</mrow>
|
129
|
-
</msub></math></stem></admitted>
|
130
|
-
<definition><p id="_">Time</p></definition></term>
|
131
|
-
</terms>
|
132
|
-
</sections>
|
133
|
-
</iec-standard>
|
134
|
-
OUTPUT
|
135
|
-
end
|
136
|
-
|
137
|
-
it "permits multiple blocks in term definition paragraph" do
|
138
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
139
|
-
= Document title
|
140
|
-
Author
|
141
|
-
:docfile: test.adoc
|
142
|
-
:nodoc:
|
143
|
-
:novalid:
|
144
|
-
:stem:
|
145
|
-
:no-isobib:
|
146
|
-
|
147
|
-
== Terms and Definitions
|
148
|
-
|
149
|
-
=== stem:[t_90]
|
150
|
-
|
151
|
-
[stem]
|
152
|
-
++++
|
153
|
-
t_A
|
154
|
-
++++
|
91
|
+
output = <<~OUTPUT
|
92
|
+
#{@blank_hdr}
|
93
|
+
<sections>
|
94
|
+
<clause id="_" inline-header="false" obligation="normative">
|
155
95
|
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
<sections>
|
160
|
-
<terms id="_" obligation="normative">
|
161
|
-
<title>Terms and definitions</title>
|
162
|
-
<p id="_">For the purposes of this document,
|
163
|
-
the following terms and definitions apply.</p>
|
164
|
-
#{TERMS_BOILERPLATE}
|
165
|
-
<term id="term-t90"><preferred><stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mrow>
|
166
|
-
<mi>t</mi>
|
167
|
-
</mrow>
|
168
|
-
<mrow>
|
169
|
-
<mn>90</mn>
|
170
|
-
</mrow>
|
171
|
-
</msub></math></stem></preferred><definition><formula id="_">
|
172
|
-
<stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mrow>
|
173
|
-
<mi>t</mi>
|
174
|
-
</mrow>
|
175
|
-
<mrow>
|
176
|
-
<mi>A</mi>
|
177
|
-
</mrow>
|
178
|
-
</msub></math></stem>
|
179
|
-
</formula><p id="_">This paragraph is extraneous</p></definition>
|
180
|
-
</term>
|
181
|
-
</terms>
|
182
|
-
</sections>
|
183
|
-
</iec-standard>
|
96
|
+
</clause>
|
97
|
+
</sections>
|
98
|
+
</iec-standard>
|
184
99
|
OUTPUT
|
100
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
101
|
+
.to be_equivalent_to xmlpp(output)
|
185
102
|
end
|
186
103
|
|
187
104
|
it "keeps any initial boilerplate from terms and definitions" do
|
188
|
-
|
105
|
+
input = <<~INPUT
|
189
106
|
#{ASCIIDOC_BLANK_HDR}
|
190
107
|
== Terms and Definitions
|
191
108
|
|
@@ -197,29 +114,32 @@ end
|
|
197
114
|
|
198
115
|
This paragraph is extraneous
|
199
116
|
INPUT
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
<
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
</
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
117
|
+
output = <<~OUTPUT
|
118
|
+
#{@blank_hdr}
|
119
|
+
<sections>
|
120
|
+
<terms id="_" obligation="normative"><title>Terms and definitions</title>
|
121
|
+
<p id="_">For the purposes of this document,
|
122
|
+
the following terms and definitions apply.</p>
|
123
|
+
#{TERMS_BOILERPLATE}
|
124
|
+
<p id='_'>I am boilerplate</p>
|
125
|
+
<ul id='_'>
|
126
|
+
<li>
|
127
|
+
<p id='_'>So am I</p>
|
128
|
+
</li>
|
129
|
+
</ul>
|
130
|
+
<term id="term-time">
|
131
|
+
<preferred><expression><name>Time</name></expression></preferred>
|
132
|
+
<definition><verbal-definition><p id="_">This paragraph is extraneous</p></verbal-definition></definition>
|
133
|
+
</term></terms>
|
134
|
+
</sections>
|
135
|
+
</iec-standard>
|
218
136
|
OUTPUT
|
137
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
138
|
+
.to be_equivalent_to xmlpp(output)
|
219
139
|
end
|
220
140
|
|
221
141
|
it "strips type from xrefs" do
|
222
|
-
|
142
|
+
input = <<~INPUT
|
223
143
|
#{ASCIIDOC_BLANK_HDR}
|
224
144
|
<<iso216>>
|
225
145
|
|
@@ -227,67 +147,38 @@ end
|
|
227
147
|
== Clause
|
228
148
|
* [[[iso216,ISO 216]]], _Reference_
|
229
149
|
INPUT
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
</
|
252
|
-
</
|
253
|
-
|
150
|
+
output = <<~OUTPUT
|
151
|
+
#{@blank_hdr}
|
152
|
+
<preface>
|
153
|
+
<foreword id="_" obligation="informative">
|
154
|
+
<title>FOREWORD</title>
|
155
|
+
<p id="_">
|
156
|
+
<eref type="inline" bibitemid="iso216" citeas="ISO 216"/>
|
157
|
+
</p>
|
158
|
+
</foreword></preface><sections>
|
159
|
+
</sections><bibliography><references id="_" obligation="informative" normative="false">
|
160
|
+
<title>Bibliography</title>
|
161
|
+
<bibitem id="iso216" type="standard">
|
162
|
+
<title format="text/plain">Reference</title>
|
163
|
+
<docidentifier>ISO 216</docidentifier>
|
164
|
+
<docnumber>216</docnumber>
|
165
|
+
<contributor>
|
166
|
+
<role type="publisher"/>
|
167
|
+
<organization>
|
168
|
+
<name>International Organization for Standardization</name>
|
169
|
+
<abbreviation>ISO</abbreviation>
|
170
|
+
</organization>
|
171
|
+
</contributor>
|
172
|
+
</bibitem>
|
173
|
+
</references></bibliography>
|
174
|
+
</iec-standard>
|
254
175
|
OUTPUT
|
255
|
-
|
256
|
-
|
257
|
-
it "processes localities in term sources" do
|
258
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
259
|
-
#{ASCIIDOC_BLANK_HDR}
|
260
|
-
== Terms and Definitions
|
261
|
-
|
262
|
-
=== Term1
|
263
|
-
|
264
|
-
[.source]
|
265
|
-
<<ISO2191,section=1>>
|
266
|
-
INPUT
|
267
|
-
#{@blank_hdr}
|
268
|
-
<sections>
|
269
|
-
<terms id="_" obligation="normative">
|
270
|
-
<title>Terms and definitions</title>
|
271
|
-
<p id="_">For the purposes of this document, the following terms and definitions apply.</p>
|
272
|
-
#{TERMS_BOILERPLATE}
|
273
|
-
<term id="term-term1">
|
274
|
-
<preferred>Term1</preferred>
|
275
|
-
<termsource status="identical">
|
276
|
-
<origin bibitemid="ISO2191" type="inline" citeas="">
|
277
|
-
<localityStack>
|
278
|
-
<locality type="section"><referenceFrom>1</referenceFrom></locality>
|
279
|
-
</localityStack>
|
280
|
-
</origin>
|
281
|
-
</termsource>
|
282
|
-
</term>
|
283
|
-
</terms>
|
284
|
-
</sections>
|
285
|
-
</iec-standard>
|
286
|
-
OUTPUT
|
176
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
177
|
+
.to be_equivalent_to xmlpp(output)
|
287
178
|
end
|
288
179
|
|
289
180
|
it "removes extraneous material from Normative References" do
|
290
|
-
|
181
|
+
input = <<~INPUT
|
291
182
|
#{ASCIIDOC_BLANK_HDR}
|
292
183
|
[bibliography]
|
293
184
|
== Normative References
|
@@ -296,6 +187,7 @@ end
|
|
296
187
|
|
297
188
|
* [[[iso216,ISO 216]]], _Reference_
|
298
189
|
INPUT
|
190
|
+
output = <<~OUTPUT
|
299
191
|
#{@blank_hdr}
|
300
192
|
<sections></sections>
|
301
193
|
<bibliography><references id="_" obligation="informative" normative="true"><title>Normative references</title>
|
@@ -316,43 +208,51 @@ end
|
|
316
208
|
</bibliography>
|
317
209
|
</iec-standard>
|
318
210
|
OUTPUT
|
211
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
212
|
+
.to be_equivalent_to xmlpp(output)
|
319
213
|
end
|
320
214
|
|
321
215
|
it "inserts IDs into paragraphs" do
|
322
|
-
|
216
|
+
input = <<~INPUT
|
323
217
|
#{ASCIIDOC_BLANK_HDR}
|
324
218
|
Paragraph
|
325
219
|
INPUT
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
220
|
+
output = <<~OUTPUT
|
221
|
+
#{@blank_hdr}
|
222
|
+
<sections>
|
223
|
+
<p id="_">Paragraph</p>
|
224
|
+
</sections>
|
225
|
+
</iec-standard>
|
331
226
|
OUTPUT
|
227
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
228
|
+
.to be_equivalent_to xmlpp(output)
|
332
229
|
end
|
333
230
|
|
334
231
|
it "inserts IDs into notes" do
|
335
|
-
|
232
|
+
input = <<~INPUT
|
336
233
|
#{ASCIIDOC_BLANK_HDR}
|
337
234
|
[example]
|
338
235
|
====
|
339
236
|
NOTE: This note has no ID
|
340
237
|
====
|
341
238
|
INPUT
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
239
|
+
output = <<~OUTPUT
|
240
|
+
#{@blank_hdr}
|
241
|
+
<sections>
|
242
|
+
<example id="_">
|
243
|
+
<note id="_">
|
244
|
+
<p id="_">This note has no ID</p>
|
245
|
+
</note>
|
246
|
+
</example>
|
247
|
+
</sections>
|
248
|
+
</iec-standard>
|
351
249
|
OUTPUT
|
250
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
251
|
+
.to be_equivalent_to xmlpp(output)
|
352
252
|
end
|
353
253
|
|
354
254
|
it "moves footnotes inside figures" do
|
355
|
-
|
255
|
+
input = <<~INPUT
|
356
256
|
#{ASCIIDOC_BLANK_HDR}
|
357
257
|
image::spec/examples/rice_images/rice_image1.png[]
|
358
258
|
|
@@ -360,23 +260,26 @@ end
|
|
360
260
|
|
361
261
|
footnote:[This is another footnote to a figure]
|
362
262
|
INPUT
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
263
|
+
output = <<~OUTPUT
|
264
|
+
#{@blank_hdr}
|
265
|
+
<sections><figure id="_">
|
266
|
+
<image src="spec/examples/rice_images/rice_image1.png" id="_" mimetype="image/png" height="auto" width="auto"/>
|
267
|
+
<fn reference="a">
|
268
|
+
<p id="_">This is a footnote to a figure</p>
|
269
|
+
</fn><fn reference="b">
|
270
|
+
<p id="_">This is another footnote to a figure</p>
|
271
|
+
</fn></figure>
|
272
|
+
|
273
|
+
</sections>
|
274
|
+
|
275
|
+
</iec-standard>
|
375
276
|
OUTPUT
|
277
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
278
|
+
.to be_equivalent_to xmlpp(output)
|
376
279
|
end
|
377
280
|
|
378
281
|
it "defaults section obligations" do
|
379
|
-
|
282
|
+
input = <<~INPUT
|
380
283
|
#{ASCIIDOC_BLANK_HDR}
|
381
284
|
|
382
285
|
== Clause
|
@@ -387,79 +290,85 @@ end
|
|
387
290
|
|
388
291
|
Text
|
389
292
|
INPUT
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
293
|
+
output = <<~OUTPUT
|
294
|
+
#{@blank_hdr}
|
295
|
+
<sections><clause id="_" inline-header="false" obligation="normative">
|
296
|
+
<title>Clause</title>
|
297
|
+
<p id="_">Text</p>
|
298
|
+
</clause>
|
299
|
+
</sections><annex id="_" inline-header="false" obligation="normative">
|
300
|
+
<title>Clause</title>
|
301
|
+
<p id="_">Text</p>
|
302
|
+
</annex>
|
303
|
+
</iec-standard>
|
400
304
|
OUTPUT
|
305
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
306
|
+
.to be_equivalent_to xmlpp(output)
|
401
307
|
end
|
402
308
|
|
403
309
|
it "extends clause levels past 5" do
|
404
|
-
|
405
|
-
|
310
|
+
input = <<~INPUT
|
311
|
+
#{ASCIIDOC_BLANK_HDR}
|
406
312
|
|
407
|
-
|
313
|
+
== Clause1
|
408
314
|
|
409
|
-
|
315
|
+
=== Clause2
|
410
316
|
|
411
|
-
|
317
|
+
==== Clause3
|
412
318
|
|
413
|
-
|
319
|
+
===== Clause4
|
414
320
|
|
415
|
-
|
321
|
+
====== Clause 5
|
416
322
|
|
417
|
-
|
418
|
-
|
323
|
+
[level=6]
|
324
|
+
====== Clause 6
|
419
325
|
|
420
|
-
|
421
|
-
|
326
|
+
[level=7]
|
327
|
+
====== Clause 7A
|
422
328
|
|
423
|
-
|
424
|
-
|
329
|
+
[level=7]
|
330
|
+
====== Clause 7B
|
425
331
|
|
426
|
-
|
427
|
-
|
332
|
+
[level=6]
|
333
|
+
====== Clause 6B
|
428
334
|
|
429
|
-
|
335
|
+
====== Clause 5B
|
430
336
|
|
431
337
|
INPUT
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
<
|
443
|
-
|
444
|
-
<
|
445
|
-
|
446
|
-
</
|
447
|
-
|
448
|
-
</
|
449
|
-
|
450
|
-
</
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
</
|
458
|
-
</clause>
|
459
|
-
</clause>
|
460
|
-
</clause>
|
461
|
-
</
|
462
|
-
</
|
338
|
+
output = <<~OUTPUT
|
339
|
+
#{@blank_hdr}
|
340
|
+
<sections>
|
341
|
+
<clause id="_" inline-header="false" obligation="normative">
|
342
|
+
<title>Clause1</title>
|
343
|
+
<clause id="_" inline-header="false" obligation="normative">
|
344
|
+
<title>Clause2</title>
|
345
|
+
<clause id="_" inline-header="false" obligation="normative">
|
346
|
+
<title>Clause3</title>
|
347
|
+
<clause id="_" inline-header="false" obligation="normative"><title>Clause4</title><clause id="_" inline-header="false" obligation="normative">
|
348
|
+
<title>Clause 5</title>
|
349
|
+
<clause id="_" inline-header="false" obligation="normative">
|
350
|
+
<title>Clause 6</title>
|
351
|
+
<clause id="_" inline-header="false" obligation="normative">
|
352
|
+
<title>Clause 7A</title>
|
353
|
+
</clause><clause id="_" inline-header="false" obligation="normative">
|
354
|
+
<title>Clause 7B</title>
|
355
|
+
</clause></clause><clause id="_" inline-header="false" obligation="normative">
|
356
|
+
<title>Clause 6B</title>
|
357
|
+
</clause></clause>
|
358
|
+
|
359
|
+
|
360
|
+
|
361
|
+
|
362
|
+
<clause id="_" inline-header="false" obligation="normative">
|
363
|
+
<title>Clause 5B</title>
|
364
|
+
</clause></clause>
|
365
|
+
</clause>
|
366
|
+
</clause>
|
367
|
+
</clause>
|
368
|
+
</sections>
|
369
|
+
</iec-standard>
|
463
370
|
OUTPUT
|
371
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
372
|
+
.to be_equivalent_to xmlpp(output)
|
464
373
|
end
|
465
374
|
end
|