metanorma-iso 1.7.1 → 1.7.2
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/.rubocop.yml +0 -4
- data/lib/asciidoctor/iso/base.rb +12 -12
- data/lib/asciidoctor/iso/cleanup.rb +1 -1
- data/lib/asciidoctor/iso/isodoc.rng +19 -1
- data/lib/asciidoctor/iso/isostandard-amd.rng +3 -0
- data/lib/asciidoctor/iso/isostandard.rng +6 -0
- data/lib/metanorma/iso/version.rb +1 -1
- data/spec/asciidoctor-iso/amd_spec.rb +575 -573
- data/spec/asciidoctor-iso/base_spec.rb +445 -454
- data/spec/asciidoctor-iso/blocks_spec.rb +333 -288
- data/spec/asciidoctor-iso/cleanup_spec.rb +813 -704
- data/spec/asciidoctor-iso/inline_spec.rb +116 -91
- data/spec/asciidoctor-iso/lists_spec.rb +128 -121
- data/spec/asciidoctor-iso/refs_spec.rb +308 -250
- data/spec/asciidoctor-iso/section_spec.rb +273 -242
- data/spec/asciidoctor-iso/table_spec.rb +258 -242
- data/spec/asciidoctor-iso/validate_spec.rb +1099 -1165
- data/spec/isodoc/amd_spec.rb +967 -946
- data/spec/isodoc/blocks_spec.rb +530 -507
- data/spec/isodoc/i18n_spec.rb +953 -911
- data/spec/isodoc/inline_spec.rb +355 -293
- data/spec/isodoc/iso_spec.rb +338 -314
- data/spec/isodoc/metadata_spec.rb +392 -382
- data/spec/isodoc/postproc_spec.rb +833 -656
- data/spec/isodoc/ref_spec.rb +374 -331
- data/spec/isodoc/section_spec.rb +608 -525
- data/spec/isodoc/table_spec.rb +472 -411
- data/spec/isodoc/terms_spec.rb +209 -185
- data/spec/isodoc/xref_spec.rb +1370 -1236
- data/spec/metanorma/processor_spec.rb +28 -26
- data/spec/spec_helper.rb +176 -193
- metadata +2 -4
- data/.rubocop.ribose.yml +0 -66
- data/spec/assets/xref_error.adoc +0 -7
@@ -2,7 +2,7 @@ require "spec_helper"
|
|
2
2
|
|
3
3
|
RSpec.describe Asciidoctor::ISO do
|
4
4
|
it "processes open blocks" do
|
5
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
5
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
6
6
|
#{ASCIIDOC_BLANK_HDR}
|
7
7
|
--
|
8
8
|
x
|
@@ -12,16 +12,18 @@ RSpec.describe Asciidoctor::ISO do
|
|
12
12
|
z
|
13
13
|
--
|
14
14
|
INPUT
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
15
|
+
#{BLANK_HDR}
|
16
|
+
<sections>
|
17
|
+
<p id="_">x</p>
|
18
|
+
<p id="_">y</p>
|
19
|
+
<p id="_">z</p>
|
20
|
+
</sections>
|
21
|
+
</iso-standard>
|
20
22
|
OUTPUT
|
21
23
|
end
|
22
24
|
|
23
25
|
it "processes stem blocks" do
|
24
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
26
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
25
27
|
#{ASCIIDOC_BLANK_HDR}
|
26
28
|
[stem]
|
27
29
|
++++
|
@@ -34,22 +36,47 @@ RSpec.describe Asciidoctor::ISO do
|
|
34
36
|
<mml:math><mml:msub xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"> <mml:mrow> <mml:mrow> <mml:mi mathvariant="bold-italic">F</mml:mi> </mml:mrow> </mml:mrow> <mml:mrow> <mml:mrow> <mml:mi mathvariant="bold-italic">Α</mml:mi> </mml:mrow> </mml:mrow> </mml:msub> </mml:math>
|
35
37
|
++++
|
36
38
|
INPUT
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
39
|
+
#{BLANK_HDR}
|
40
|
+
<sections>
|
41
|
+
<formula id="_">
|
42
|
+
<stem type="MathML">
|
43
|
+
<math xmlns="http://www.w3.org/1998/Math/MathML">
|
44
|
+
<mi>r</mi>
|
45
|
+
<mo>=</mo>
|
46
|
+
<mn>1</mn>
|
47
|
+
<mi>%</mi>
|
48
|
+
<mi>r</mi>
|
49
|
+
<mo>=</mo>
|
50
|
+
<mn>1</mn>
|
51
|
+
<mi>%</mi>
|
52
|
+
</math>
|
53
|
+
</stem>
|
54
|
+
</formula>
|
55
|
+
<formula id="_">
|
56
|
+
<stem type="MathML">
|
57
|
+
<math xmlns="http://www.w3.org/1998/Math/MathML">
|
58
|
+
<msub>
|
59
|
+
<mrow>
|
60
|
+
<mrow>
|
61
|
+
<mi mathvariant="bold-italic">F</mi>
|
62
|
+
</mrow>
|
63
|
+
</mrow>
|
64
|
+
<mrow>
|
65
|
+
<mrow>
|
66
|
+
<mi mathvariant="bold-italic">Α</mi>
|
67
|
+
</mrow>
|
68
|
+
</mrow>
|
69
|
+
</msub>
|
70
|
+
</math>
|
71
|
+
</stem>
|
72
|
+
</formula>
|
73
|
+
</sections>
|
74
|
+
</iso-standard>
|
48
75
|
OUTPUT
|
49
76
|
end
|
50
77
|
|
51
|
-
|
52
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
78
|
+
it "ignores review blocks unless document is in draft mode" do
|
79
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
53
80
|
#{ASCIIDOC_BLANK_HDR}
|
54
81
|
[[foreword]]
|
55
82
|
.Foreword
|
@@ -61,16 +88,17 @@ RSpec.describe Asciidoctor::ISO do
|
|
61
88
|
|
62
89
|
For further information on the Foreword, see *ISO/IEC Directives, Part 2, 2016, Clause 12.*
|
63
90
|
****
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
91
|
+
INPUT
|
92
|
+
#{BLANK_HDR}
|
93
|
+
<sections>
|
94
|
+
<p id="foreword">Foreword</p>
|
95
|
+
</sections>
|
96
|
+
</iso-standard>
|
97
|
+
OUTPUT
|
98
|
+
end
|
71
99
|
|
72
100
|
it "processes review blocks if document is in draft mode" do
|
73
|
-
|
101
|
+
output = Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
74
102
|
= Document title
|
75
103
|
Author
|
76
104
|
:docfile: test.adoc
|
@@ -89,94 +117,96 @@ RSpec.describe Asciidoctor::ISO do
|
|
89
117
|
|
90
118
|
For further information on the Foreword, see *ISO/IEC Directives, Part 2, 2016, Clause 12.*
|
91
119
|
****
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
120
|
+
INPUT
|
121
|
+
expect(xmlpp(strip_guid(output).sub(/^.+<sections>/m, "<iso-standard><sections>")))
|
122
|
+
.to be_equivalent_to xmlpp(<<~"OUTPUT")
|
123
|
+
<iso-standard>
|
124
|
+
<sections>
|
125
|
+
<p id="foreword">Foreword</p>
|
126
|
+
<review date="20170101T00:00:00Z" from="foreword" id="_" reviewer="ISO" to="foreword">
|
127
|
+
<p id="_">A Foreword shall appear in each document. The generic text is shown here. It does not contain requirements, recommendations or permissions.</p>
|
128
|
+
<p id="_">For further information on the Foreword, see#{' '}
|
129
|
+
<strong>ISO/IEC Directives, Part 2, 2016, Clause 12.</strong></p>
|
130
|
+
</review>
|
131
|
+
</sections>
|
132
|
+
</iso-standard>
|
99
133
|
OUTPUT
|
100
134
|
end
|
101
135
|
|
102
136
|
it "processes term notes" do
|
103
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
137
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
104
138
|
#{ASCIIDOC_BLANK_HDR}
|
105
139
|
== Terms and Definitions
|
106
140
|
|
107
141
|
=== Term1
|
108
142
|
|
109
143
|
NOTE: This is a note
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
OUTPUT
|
144
|
+
INPUT
|
145
|
+
#{BLANK_HDR}
|
146
|
+
<sections>
|
147
|
+
<terms id="_" obligation="normative">
|
148
|
+
<title>Terms and definitions</title>
|
149
|
+
#{TERM_BOILERPLATE}#{' '}
|
150
|
+
<term id="term-term1">
|
151
|
+
<preferred>Term1</preferred>
|
152
|
+
<termnote id="_">
|
153
|
+
<p id="_">This is a note</p></termnote>
|
154
|
+
</term>
|
155
|
+
</terms>
|
156
|
+
</sections>
|
157
|
+
</iso-standard>
|
158
|
+
OUTPUT
|
126
159
|
end
|
127
160
|
|
128
|
-
|
129
|
-
|
161
|
+
it "processes notes" do
|
162
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
130
163
|
#{ASCIIDOC_BLANK_HDR}
|
131
164
|
NOTE: This is a note
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
end
|
165
|
+
INPUT
|
166
|
+
#{BLANK_HDR}
|
167
|
+
<sections>
|
168
|
+
<note id="_">
|
169
|
+
<p id="_">This is a note</p>
|
170
|
+
</note>
|
171
|
+
</sections>
|
172
|
+
</iso-standard>
|
173
|
+
OUTPUT
|
174
|
+
end
|
143
175
|
|
144
|
-
|
145
|
-
|
176
|
+
it "processes literals" do
|
177
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
146
178
|
#{ASCIIDOC_BLANK_HDR}
|
147
179
|
....
|
148
180
|
LITERAL
|
149
181
|
....
|
150
|
-
|
182
|
+
INPUT
|
151
183
|
#{BLANK_HDR}
|
152
|
-
<sections>
|
153
|
-
|
154
|
-
|
155
|
-
</figure>
|
156
|
-
</sections>
|
157
|
-
</iso-standard>
|
158
|
-
|
159
|
-
|
184
|
+
<sections>
|
185
|
+
<figure id="_">
|
186
|
+
<pre id="_">LITERAL</pre>
|
187
|
+
</figure>
|
188
|
+
</sections>
|
189
|
+
</iso-standard>
|
190
|
+
OUTPUT
|
191
|
+
end
|
160
192
|
|
161
|
-
|
162
|
-
|
193
|
+
it "processes simple admonitions with Asciidoc names" do
|
194
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
163
195
|
#{ASCIIDOC_BLANK_HDR}
|
164
196
|
CAUTION: Only use paddy or parboiled rice for the determination of husked rice yield.
|
165
|
-
|
197
|
+
INPUT
|
166
198
|
#{BLANK_HDR}
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
end
|
176
|
-
|
199
|
+
<sections>
|
200
|
+
<admonition id="_" type="caution">
|
201
|
+
<p id="_">Only use paddy or parboiled rice for the determination of husked rice yield.</p>
|
202
|
+
</admonition>
|
203
|
+
</sections>
|
204
|
+
</iso-standard>
|
205
|
+
OUTPUT
|
206
|
+
end
|
177
207
|
|
178
|
-
|
179
|
-
|
208
|
+
it "processes complex admonitions with non-Asciidoc names" do
|
209
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
180
210
|
#{ASCIIDOC_BLANK_HDR}
|
181
211
|
[CAUTION,type=Safety Precautions]
|
182
212
|
.Safety Precautions
|
@@ -187,29 +217,31 @@ RSpec.describe Asciidoctor::ISO do
|
|
187
217
|
. More than two glasses of orange juice in 24 hours makes them howl in harmony with alarms and sirens.
|
188
218
|
. Celery makes them sad.
|
189
219
|
====
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
220
|
+
INPUT
|
221
|
+
#{BLANK_HDR}
|
222
|
+
<sections>
|
223
|
+
<admonition id="_" type="safety precautions">
|
224
|
+
<name>Safety Precautions</name>
|
225
|
+
<p id="_">While werewolves are hardy community members, keep in mind the following dietary concerns:</p>
|
226
|
+
<ol id="_">
|
227
|
+
<li>
|
228
|
+
<p id="_">They are allergic to cinnamon.</p>
|
229
|
+
</li>
|
230
|
+
<li>
|
231
|
+
<p id="_">More than two glasses of orange juice in 24 hours makes them howl in harmony with alarms and sirens.</p>
|
232
|
+
</li>
|
233
|
+
<li>
|
234
|
+
<p id="_">Celery makes them sad.</p>
|
235
|
+
</li>
|
236
|
+
</ol>
|
237
|
+
</admonition>
|
238
|
+
</sections>
|
239
|
+
</iso-standard>
|
240
|
+
OUTPUT
|
241
|
+
end
|
210
242
|
|
211
|
-
|
212
|
-
|
243
|
+
it "processes term examples" do
|
244
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
213
245
|
#{ASCIIDOC_BLANK_HDR}
|
214
246
|
== Terms and Definitions
|
215
247
|
|
@@ -217,27 +249,25 @@ RSpec.describe Asciidoctor::ISO do
|
|
217
249
|
|
218
250
|
[example]
|
219
251
|
This is an example
|
220
|
-
|
252
|
+
INPUT
|
221
253
|
#{BLANK_HDR}
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
OUTPUT
|
237
|
-
end
|
254
|
+
<sections>
|
255
|
+
<terms id="_" obligation="normative">
|
256
|
+
<title>Terms and definitions</title>
|
257
|
+
#{TERM_BOILERPLATE}
|
258
|
+
<term id="term-term1">
|
259
|
+
<preferred>Term1</preferred>
|
260
|
+
<termexample id="_">
|
261
|
+
<p id="_">This is an example</p></termexample>
|
262
|
+
</term>
|
263
|
+
</terms>
|
264
|
+
</sections>
|
265
|
+
</iso-standard>
|
266
|
+
OUTPUT
|
267
|
+
end
|
238
268
|
|
239
|
-
|
240
|
-
|
269
|
+
it "processes examples" do
|
270
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
241
271
|
#{ASCIIDOC_BLANK_HDR}
|
242
272
|
[example]
|
243
273
|
====
|
@@ -245,127 +275,135 @@ RSpec.describe Asciidoctor::ISO do
|
|
245
275
|
|
246
276
|
Amen
|
247
277
|
====
|
248
|
-
|
278
|
+
INPUT
|
249
279
|
#{BLANK_HDR}
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
280
|
+
<sections>
|
281
|
+
<example id="_">
|
282
|
+
<p id="_">This is an example</p>
|
283
|
+
<p id="_">Amen</p>
|
284
|
+
</example>
|
285
|
+
</sections>
|
286
|
+
</iso-standard>
|
287
|
+
OUTPUT
|
288
|
+
end
|
257
289
|
|
258
|
-
|
259
|
-
|
290
|
+
it "processes preambles" do
|
291
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
260
292
|
#{ASCIIDOC_BLANK_HDR}
|
261
293
|
This is a preamble
|
262
294
|
|
263
295
|
== Section 1
|
264
|
-
|
296
|
+
INPUT
|
265
297
|
#{BLANK_HDR}
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
298
|
+
<preface>
|
299
|
+
<foreword id="_" obligation="informative">
|
300
|
+
<title>Foreword</title>
|
301
|
+
<p id="_">This is a preamble</p>
|
302
|
+
</foreword>
|
303
|
+
</preface>
|
304
|
+
<sections>
|
305
|
+
<clause id="_" inline-header="false" obligation="normative">
|
306
|
+
<title>Section 1</title>
|
307
|
+
</clause>
|
308
|
+
</sections>
|
309
|
+
</iso-standard>
|
310
|
+
OUTPUT
|
311
|
+
end
|
276
312
|
|
277
|
-
|
278
|
-
|
313
|
+
it "processes images" do
|
314
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
279
315
|
#{ASCIIDOC_BLANK_HDR}
|
280
316
|
.Split-it-right sample divider
|
281
317
|
image::spec/examples/rice_images/rice_image1.png[]
|
282
318
|
|
283
|
-
|
319
|
+
INPUT
|
284
320
|
#{BLANK_HDR}
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
321
|
+
<sections>
|
322
|
+
<figure id="_">
|
323
|
+
<name>Split-it-right sample divider</name>
|
324
|
+
<image height="auto" id="_" mimetype="image/png" src="spec/examples/rice_images/rice_image1.png" width="auto"/>
|
325
|
+
</figure>
|
326
|
+
</sections>
|
327
|
+
</iso-standard>
|
328
|
+
OUTPUT
|
329
|
+
end
|
294
330
|
|
295
|
-
|
296
|
-
|
331
|
+
it "accepts width and height attributes on images" do
|
332
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
297
333
|
#{ASCIIDOC_BLANK_HDR}
|
298
334
|
[height=4,width=3]
|
299
335
|
image::spec/examples/rice_images/rice_image1.png[]
|
300
336
|
|
301
|
-
|
337
|
+
INPUT
|
302
338
|
#{BLANK_HDR}
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
339
|
+
<sections>
|
340
|
+
<figure id="_">
|
341
|
+
<image height="4" id="_" mimetype="image/png" src="spec/examples/rice_images/rice_image1.png" width="3"/>
|
342
|
+
</figure>
|
343
|
+
</sections>
|
344
|
+
</iso-standard>
|
345
|
+
OUTPUT
|
346
|
+
end
|
311
347
|
|
312
|
-
|
313
|
-
|
348
|
+
it "accepts auto for width and height attributes on images" do
|
349
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
314
350
|
#{ASCIIDOC_BLANK_HDR}
|
315
351
|
[height=4,width=auto]
|
316
352
|
image::spec/examples/rice_images/rice_image1.png[]
|
317
353
|
|
318
|
-
|
354
|
+
INPUT
|
319
355
|
#{BLANK_HDR}
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
356
|
+
<sections>
|
357
|
+
<figure id="_">
|
358
|
+
<image height="4" id="_" mimetype="image/png" src="spec/examples/rice_images/rice_image1.png" width="auto"/>
|
359
|
+
</figure>
|
360
|
+
</sections>
|
361
|
+
</iso-standard>
|
362
|
+
OUTPUT
|
363
|
+
end
|
328
364
|
|
329
|
-
|
330
|
-
|
365
|
+
it "accepts alignment attribute on paragraphs" do
|
366
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
331
367
|
#{ASCIIDOC_BLANK_HDR}
|
332
368
|
[align=right]
|
333
369
|
This para is right-aligned.
|
334
|
-
|
370
|
+
INPUT
|
335
371
|
#{BLANK_HDR}
|
336
|
-
|
337
|
-
|
338
|
-
|
372
|
+
<sections>
|
373
|
+
<p align="right" id="_">This para is right-aligned.</p>
|
374
|
+
</sections>
|
339
375
|
</iso-standard>
|
340
|
-
|
341
|
-
|
376
|
+
OUTPUT
|
377
|
+
end
|
342
378
|
|
343
|
-
|
344
|
-
|
379
|
+
it "processes blockquotes" do
|
380
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
345
381
|
#{ASCIIDOC_BLANK_HDR}
|
346
382
|
[quote, ISO, "ISO7301,section 1"]
|
347
383
|
____
|
348
384
|
Block quotation
|
349
385
|
____
|
350
|
-
|
386
|
+
INPUT
|
351
387
|
#{BLANK_HDR}
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
388
|
+
<sections>
|
389
|
+
<quote id="_">
|
390
|
+
<source bibitemid="ISO7301" citeas="" type="inline">
|
391
|
+
<localityStack>
|
392
|
+
<locality type="section">
|
393
|
+
<referenceFrom>1</referenceFrom>
|
394
|
+
</locality>
|
395
|
+
</localityStack>
|
396
|
+
</source>
|
397
|
+
<author>ISO</author>
|
398
|
+
<p id="_">Block quotation</p>
|
399
|
+
</quote>
|
400
|
+
</sections>
|
401
|
+
</iso-standard>
|
402
|
+
OUTPUT
|
403
|
+
end
|
366
404
|
|
367
|
-
|
368
|
-
|
405
|
+
it "processes source code" do
|
406
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
369
407
|
#{ASCIIDOC_BLANK_HDR}
|
370
408
|
[source,ruby]
|
371
409
|
--
|
@@ -374,20 +412,22 @@ RSpec.describe Asciidoctor::ISO do
|
|
374
412
|
puts x
|
375
413
|
end
|
376
414
|
--
|
377
|
-
|
415
|
+
INPUT
|
378
416
|
#{BLANK_HDR}
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
417
|
+
<sections>
|
418
|
+
<sourcecode id="_" lang="ruby">
|
419
|
+
puts "Hello, world."
|
420
|
+
%w{a b c}.each do |x|
|
421
|
+
puts x
|
422
|
+
end
|
423
|
+
</sourcecode>
|
424
|
+
</sections>
|
425
|
+
</iso-standard>
|
426
|
+
OUTPUT
|
427
|
+
end
|
388
428
|
|
389
|
-
|
390
|
-
|
429
|
+
it "processes callouts" do
|
430
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
391
431
|
#{ASCIIDOC_BLANK_HDR}
|
392
432
|
[source,ruby]
|
393
433
|
--
|
@@ -398,23 +438,28 @@ RSpec.describe Asciidoctor::ISO do
|
|
398
438
|
--
|
399
439
|
<1> This is one callout
|
400
440
|
<2> This is another callout
|
401
|
-
|
441
|
+
INPUT
|
402
442
|
#{BLANK_HDR}
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
443
|
+
<sections>
|
444
|
+
<sourcecode id="_" lang="ruby">
|
445
|
+
puts "Hello, world." <callout target="_">1</callout>
|
446
|
+
%w{a b c}.each do |x|
|
447
|
+
puts x <callout target="_">2</callout>
|
448
|
+
end
|
449
|
+
<annotation id="_">
|
450
|
+
<p id="_">This is one callout</p>
|
451
|
+
</annotation>
|
452
|
+
<annotation id="_">
|
453
|
+
<p id="_">This is another callout</p>
|
454
|
+
</annotation>
|
455
|
+
</sourcecode>
|
456
|
+
</sections>
|
457
|
+
</iso-standard>
|
458
|
+
OUTPUT
|
459
|
+
end
|
415
460
|
|
416
|
-
|
417
|
-
|
461
|
+
it "processes unmodified term sources" do
|
462
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
418
463
|
#{ASCIIDOC_BLANK_HDR}
|
419
464
|
== Terms and Definitions
|
420
465
|
|
@@ -422,30 +467,31 @@ RSpec.describe Asciidoctor::ISO do
|
|
422
467
|
|
423
468
|
[.source]
|
424
469
|
<<ISO2191,section=1>>
|
425
|
-
|
470
|
+
INPUT
|
426
471
|
#{BLANK_HDR}
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
472
|
+
<sections>
|
473
|
+
<terms id="_" obligation="normative">
|
474
|
+
<title>Terms and definitions</title>
|
475
|
+
#{TERM_BOILERPLATE}
|
476
|
+
<term id="term-term1">
|
477
|
+
<preferred>Term1</preferred>
|
478
|
+
<termsource status="identical">
|
479
|
+
<origin bibitemid="ISO2191" citeas="" type="inline">
|
480
|
+
<localityStack>
|
481
|
+
<locality type="section">
|
482
|
+
<referenceFrom>1</referenceFrom></locality>
|
483
|
+
</localityStack>
|
484
|
+
</origin>
|
485
|
+
</termsource>
|
486
|
+
</term>
|
487
|
+
</terms>
|
488
|
+
</sections>
|
489
|
+
</iso-standard>
|
490
|
+
OUTPUT
|
491
|
+
end
|
446
492
|
|
447
|
-
|
448
|
-
|
493
|
+
it "processes modified term sources" do
|
494
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
449
495
|
#{ASCIIDOC_BLANK_HDR}
|
450
496
|
== Terms and Definitions
|
451
497
|
|
@@ -453,30 +499,29 @@ RSpec.describe Asciidoctor::ISO do
|
|
453
499
|
|
454
500
|
[.source]
|
455
501
|
<<ISO2191,section=1>>, with adjustments
|
456
|
-
|
502
|
+
INPUT
|
457
503
|
#{BLANK_HDR}
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
504
|
+
<sections>
|
505
|
+
<terms id="_" obligation="normative">
|
506
|
+
<title>Terms and definitions</title>
|
507
|
+
#{TERM_BOILERPLATE}
|
508
|
+
<term id="term-term1">
|
509
|
+
<preferred>Term1</preferred>
|
510
|
+
<termsource status="modified">
|
511
|
+
<origin bibitemid="ISO2191" citeas="" type="inline">
|
512
|
+
<localityStack>
|
513
|
+
<locality type="section">
|
514
|
+
<referenceFrom>1</referenceFrom></locality>
|
515
|
+
</localityStack>
|
516
|
+
</origin>
|
517
|
+
<modification>
|
518
|
+
<p id="_">with adjustments</p>
|
519
|
+
</modification>
|
520
|
+
</termsource>
|
521
|
+
</term>
|
522
|
+
</terms>
|
523
|
+
</sections>
|
524
|
+
</iso-standard>
|
525
|
+
OUTPUT
|
526
|
+
end
|
482
527
|
end
|