metanorma-standoc 1.9.0 → 1.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/rake.yml +3 -13
- data/.hound.yml +3 -1
- data/.rubocop.yml +4 -8
- data/lib/asciidoctor/standoc/base.rb +31 -35
- data/lib/asciidoctor/standoc/biblio.rng +1 -0
- data/lib/asciidoctor/standoc/blocks.rb +25 -9
- data/lib/asciidoctor/standoc/blocks_notes.rb +41 -24
- data/lib/asciidoctor/standoc/cleanup.rb +59 -84
- data/lib/asciidoctor/standoc/cleanup_block.rb +63 -85
- data/lib/asciidoctor/standoc/cleanup_boilerplate.rb +28 -15
- data/lib/asciidoctor/standoc/cleanup_footnotes.rb +1 -0
- data/lib/asciidoctor/standoc/cleanup_image.rb +71 -0
- data/lib/asciidoctor/standoc/cleanup_inline.rb +117 -77
- data/lib/asciidoctor/standoc/cleanup_maths.rb +36 -27
- data/lib/asciidoctor/standoc/cleanup_ref.rb +31 -15
- data/lib/asciidoctor/standoc/cleanup_ref_dl.rb +1 -1
- data/lib/asciidoctor/standoc/cleanup_reqt.rb +47 -0
- data/lib/asciidoctor/standoc/cleanup_section.rb +77 -135
- data/lib/asciidoctor/standoc/cleanup_section_names.rb +75 -0
- data/lib/asciidoctor/standoc/cleanup_terms.rb +19 -18
- data/lib/asciidoctor/standoc/converter.rb +7 -2
- data/lib/asciidoctor/standoc/datamodel/plantuml_renderer.rb +67 -66
- data/lib/asciidoctor/standoc/front.rb +35 -18
- data/lib/asciidoctor/standoc/front_contributor.rb +70 -45
- data/lib/asciidoctor/standoc/inline.rb +45 -34
- data/lib/asciidoctor/standoc/isodoc.rng +209 -4
- data/lib/asciidoctor/standoc/lists.rb +4 -2
- data/lib/asciidoctor/standoc/macros.rb +11 -11
- data/lib/asciidoctor/standoc/macros_form.rb +63 -0
- data/lib/asciidoctor/standoc/macros_plantuml.rb +19 -21
- data/lib/asciidoctor/standoc/macros_terms.rb +33 -23
- data/lib/asciidoctor/standoc/ref.rb +87 -112
- data/lib/asciidoctor/standoc/ref_date_id.rb +62 -0
- data/lib/asciidoctor/standoc/ref_sect.rb +20 -17
- data/lib/asciidoctor/standoc/section.rb +3 -1
- data/lib/asciidoctor/standoc/term_lookup_cleanup.rb +40 -27
- data/lib/asciidoctor/standoc/terms.rb +25 -18
- data/lib/asciidoctor/standoc/utils.rb +35 -9
- data/lib/asciidoctor/standoc/validate.rb +48 -33
- data/lib/metanorma-standoc.rb +0 -1
- data/lib/metanorma/standoc/version.rb +1 -1
- data/metanorma-standoc.gemspec +4 -4
- data/spec/asciidoctor/base_spec.rb +701 -508
- data/spec/asciidoctor/blocks_spec.rb +831 -738
- data/spec/asciidoctor/cleanup_sections_spec.rb +51 -14
- data/spec/asciidoctor/cleanup_spec.rb +889 -682
- data/spec/asciidoctor/inline_spec.rb +62 -14
- data/spec/asciidoctor/isobib_cache_spec.rb +404 -358
- data/spec/asciidoctor/lists_spec.rb +149 -137
- data/spec/asciidoctor/macros_plantuml_spec.rb +8 -8
- data/spec/asciidoctor/macros_spec.rb +923 -503
- data/spec/asciidoctor/macros_yaml2text_spec.rb +1 -1
- data/spec/asciidoctor/refs_dl_spec.rb +4 -4
- data/spec/asciidoctor/refs_spec.rb +1528 -1533
- data/spec/asciidoctor/section_spec.rb +405 -299
- data/spec/asciidoctor/table_spec.rb +6 -6
- data/spec/asciidoctor/validate_spec.rb +342 -304
- data/spec/spec_helper.rb +13 -9
- data/spec/vcr_cassettes/dated_iso_ref_joint_iso_iec.yml +54 -54
- data/spec/vcr_cassettes/isobib_get_123.yml +13 -13
- data/spec/vcr_cassettes/isobib_get_123_1.yml +25 -25
- data/spec/vcr_cassettes/isobib_get_123_1_fr.yml +37 -37
- data/spec/vcr_cassettes/isobib_get_123_2001.yml +12 -12
- data/spec/vcr_cassettes/isobib_get_124.yml +13 -13
- data/spec/vcr_cassettes/rfcbib_get_rfc8341.yml +14 -14
- data/spec/vcr_cassettes/separates_iev_citations_by_top_level_clause.yml +46 -46
- metadata +16 -15
- data/lib/liquid/custom_blocks/key_iterator.rb +0 -21
- data/lib/liquid/custom_blocks/with_json_nested_context.rb +0 -18
- data/lib/liquid/custom_blocks/with_yaml_nested_context.rb +0 -19
- data/lib/liquid/custom_filters/values.rb +0 -7
@@ -2,25 +2,28 @@ require "spec_helper"
|
|
2
2
|
require "open3"
|
3
3
|
|
4
4
|
RSpec.describe Asciidoctor::Standoc do
|
5
|
-
|
6
|
-
|
5
|
+
it "processes format-specific pass blocks" do
|
6
|
+
input = <<~INPUT
|
7
7
|
#{ASCIIDOC_BLANK_HDR}
|
8
|
-
|
8
|
+
|
9
9
|
[format="rfc,html"]
|
10
10
|
++++
|
11
11
|
<abc>X > Y</abc>
|
12
12
|
++++
|
13
13
|
INPUT
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
14
|
+
output = <<~OUTPUT
|
15
|
+
#{BLANK_HDR}
|
16
|
+
<sections>
|
17
|
+
<passthrough formats='rfc,html'><abc>X > Y</abc></passthrough>
|
18
|
+
</sections>
|
19
|
+
</standard-document>
|
19
20
|
OUTPUT
|
21
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
22
|
+
.to be_equivalent_to xmlpp(output)
|
20
23
|
end
|
21
24
|
|
22
25
|
it "processes Metanorma XML pass blocks" do
|
23
|
-
|
26
|
+
input = <<~INPUT
|
24
27
|
#{ASCIIDOC_BLANK_HDR}
|
25
28
|
|
26
29
|
++++
|
@@ -31,16 +34,19 @@ RSpec.describe Asciidoctor::Standoc do
|
|
31
34
|
Y</abc>
|
32
35
|
++++
|
33
36
|
INPUT
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
37
|
+
output = <<~OUTPUT
|
38
|
+
#{BLANK_HDR}
|
39
|
+
<sections>
|
40
|
+
<abc>X > Y</abc>
|
41
|
+
</sections>
|
42
|
+
</standard-document>
|
39
43
|
OUTPUT
|
44
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
45
|
+
.to be_equivalent_to xmlpp(output)
|
40
46
|
end
|
41
47
|
|
42
48
|
it "processes open blocks" do
|
43
|
-
|
49
|
+
input = <<~INPUT
|
44
50
|
#{ASCIIDOC_BLANK_HDR}
|
45
51
|
--
|
46
52
|
x
|
@@ -50,23 +56,26 @@ RSpec.describe Asciidoctor::Standoc do
|
|
50
56
|
z
|
51
57
|
--
|
52
58
|
INPUT
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
59
|
+
output = <<~OUTPUT
|
60
|
+
#{BLANK_HDR}
|
61
|
+
<sections><p id="_">x</p>
|
62
|
+
<p id="_">y</p>
|
63
|
+
<p id="_">z</p></sections>
|
64
|
+
</standard-document>
|
58
65
|
OUTPUT
|
66
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
67
|
+
.to be_equivalent_to xmlpp(output)
|
59
68
|
end
|
60
69
|
|
61
70
|
it "processes stem blocks" do
|
62
|
-
|
71
|
+
input = <<~INPUT
|
63
72
|
#{ASCIIDOC_BLANK_HDR}
|
64
73
|
|
65
74
|
[[ABC]]
|
66
75
|
[stem%inequality,number=3,keep-with-next=true,keep-lines-together=true]
|
67
76
|
++++
|
68
|
-
r = 1 %
|
69
|
-
r = 1 %
|
77
|
+
r = 1 %
|
78
|
+
r = 1 %
|
70
79
|
++++
|
71
80
|
|
72
81
|
[stem%unnumbered]
|
@@ -85,155 +94,158 @@ RSpec.describe Asciidoctor::Standoc do
|
|
85
94
|
++++
|
86
95
|
|
87
96
|
INPUT
|
88
|
-
|
89
|
-
|
90
|
-
<
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
97
|
+
output = <<~OUTPUT
|
98
|
+
#{BLANK_HDR}
|
99
|
+
<sections>
|
100
|
+
<formula id='ABC' number='3' keep-with-next='true' keep-lines-together='true' inequality='true'>
|
101
|
+
<stem type='MathML'>
|
102
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
103
|
+
<mi>r</mi>
|
104
|
+
<mo>=</mo>
|
105
|
+
<mn>1</mn>
|
106
|
+
<mi>%</mi>
|
107
|
+
<mi>r</mi>
|
108
|
+
<mo>=</mo>
|
109
|
+
<mn>1</mn>
|
110
|
+
<mi>%</mi>
|
111
|
+
</math>
|
112
|
+
</stem>
|
113
|
+
</formula>
|
114
|
+
<formula id='_' unnumbered='true'>
|
115
|
+
<stem type='MathML'>
|
116
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
117
|
+
<msub>
|
118
|
+
<mrow>
|
119
|
+
<mrow>
|
120
|
+
<mi mathvariant='bold-italic'>F</mi>
|
121
|
+
</mrow>
|
122
|
+
</mrow>
|
123
|
+
<mrow>
|
124
|
+
<mrow>
|
125
|
+
<mi mathvariant='bold-italic'>Α</mi>
|
126
|
+
</mrow>
|
127
|
+
</mrow>
|
128
|
+
</msub>
|
129
|
+
</math>
|
130
|
+
</stem>
|
131
|
+
</formula>
|
132
|
+
<formula id='_' subsequence='A'>
|
133
|
+
<stem type='MathML'>
|
134
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
135
|
+
<mrow>
|
136
|
+
<mi>M</mi>
|
137
|
+
<mo>=</mo>
|
138
|
+
<mo>[</mo>
|
139
|
+
<mtable>
|
140
|
+
<mtr>
|
141
|
+
<mtd>
|
142
|
+
<mrow>
|
143
|
+
<mo>−</mo>
|
144
|
+
<mi>sin</mi>
|
145
|
+
</mrow>
|
146
|
+
<msub>
|
147
|
+
<mi>λ</mi>
|
148
|
+
<mn>0</mn>
|
149
|
+
</msub>
|
150
|
+
</mtd>
|
151
|
+
<mtd>
|
152
|
+
<mi>cos</mi>
|
153
|
+
<msub>
|
154
|
+
<mi>λ</mi>
|
155
|
+
<mn>0</mn>
|
156
|
+
</msub>
|
157
|
+
</mtd>
|
158
|
+
<mtd>
|
159
|
+
<mn>0</mn>
|
160
|
+
</mtd>
|
161
|
+
</mtr>
|
162
|
+
<mtr>
|
163
|
+
<mtd>
|
164
|
+
<mrow>
|
165
|
+
<mo>−</mo>
|
166
|
+
<mi>sin</mi>
|
167
|
+
</mrow>
|
168
|
+
<msub>
|
169
|
+
<mi>φ</mi>
|
170
|
+
<mn>0</mn>
|
171
|
+
</msub>
|
172
|
+
<mi>cos</mi>
|
173
|
+
<msub>
|
174
|
+
<mi>λ</mi>
|
175
|
+
<mn>0</mn>
|
176
|
+
</msub>
|
177
|
+
</mtd>
|
178
|
+
<mtd>
|
179
|
+
<mrow>
|
180
|
+
<mo>−</mo>
|
181
|
+
<mi>sin</mi>
|
182
|
+
</mrow>
|
183
|
+
<msub>
|
184
|
+
<mi>φ</mi>
|
185
|
+
<mn>0</mn>
|
186
|
+
</msub>
|
187
|
+
<mi>sin</mi>
|
188
|
+
<msub>
|
189
|
+
<mi>λ</mi>
|
190
|
+
<mn>0</mn>
|
191
|
+
</msub>
|
192
|
+
</mtd>
|
193
|
+
<mtd>
|
194
|
+
<mi>cos</mi>
|
195
|
+
<msub>
|
196
|
+
<mi>φ</mi>
|
197
|
+
<mn>0</mn>
|
198
|
+
</msub>
|
199
|
+
</mtd>
|
200
|
+
</mtr>
|
201
|
+
<mtr>
|
202
|
+
<mtd>
|
203
|
+
<mi>cos</mi>
|
204
|
+
<msub>
|
205
|
+
<mi>φ</mi>
|
206
|
+
<mn>0</mn>
|
207
|
+
</msub>
|
208
|
+
<mi>cos</mi>
|
209
|
+
<msub>
|
210
|
+
<mi>λ</mi>
|
211
|
+
<mn>0</mn>
|
212
|
+
</msub>
|
213
|
+
</mtd>
|
214
|
+
<mtd>
|
215
|
+
<mi>cos</mi>
|
216
|
+
<msub>
|
217
|
+
<mi>φ</mi>
|
218
|
+
<mn>0</mn>
|
219
|
+
</msub>
|
220
|
+
<mi>sin</mi>
|
221
|
+
<msub>
|
222
|
+
<mi>λ</mi>
|
223
|
+
<mn>0</mn>
|
224
|
+
</msub>
|
225
|
+
</mtd>
|
226
|
+
<mtd>
|
227
|
+
<mi>sin</mi>
|
228
|
+
<msub>
|
229
|
+
<mi>φ</mi>
|
230
|
+
<mn>0</mn>
|
231
|
+
</msub>
|
232
|
+
</mtd>
|
233
|
+
</mtr>
|
234
|
+
</mtable>
|
235
|
+
<mo>]</mo>
|
236
|
+
</mrow>
|
237
|
+
</math>
|
238
|
+
</stem>
|
239
|
+
</formula>
|
240
|
+
</sections>
|
241
|
+
</standard-document>
|
232
242
|
OUTPUT
|
243
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
244
|
+
.to be_equivalent_to xmlpp(output)
|
233
245
|
end
|
234
|
-
|
235
|
-
|
236
|
-
|
246
|
+
|
247
|
+
it "ignores review blocks unless document is in draft mode" do
|
248
|
+
input = <<~INPUT
|
237
249
|
#{ASCIIDOC_BLANK_HDR}
|
238
250
|
[[foreword]]
|
239
251
|
.Foreword
|
@@ -245,16 +257,17 @@ RSpec.describe Asciidoctor::Standoc do
|
|
245
257
|
|
246
258
|
For further information on the Foreword, see *ISO/IEC Directives, Part 2, 2016, Clause 12.*
|
247
259
|
****
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
260
|
+
INPUT
|
261
|
+
output = <<~OUTPUT
|
262
|
+
#{BLANK_HDR}
|
263
|
+
<sections><p id="foreword">Foreword</p>
|
264
|
+
</sections>
|
265
|
+
</standard-document>
|
266
|
+
OUTPUT
|
267
|
+
end
|
255
268
|
|
256
269
|
it "processes review blocks if document is in draft mode" do
|
257
|
-
|
270
|
+
input = <<~INPUT
|
258
271
|
= Document title
|
259
272
|
Author
|
260
273
|
:docfile: test.adoc
|
@@ -272,7 +285,8 @@ RSpec.describe Asciidoctor::Standoc do
|
|
272
285
|
|
273
286
|
For further information on the Foreword, see *ISO/IEC Directives, Part 2, 2016, Clause 12.*
|
274
287
|
****
|
275
|
-
|
288
|
+
INPUT
|
289
|
+
output = <<~OUTPUT
|
276
290
|
<standard-document xmlns="https://www.metanorma.org/ns/standoc" type="semantic" version="#{Metanorma::Standoc::VERSION}">
|
277
291
|
<bibdata type="standard">
|
278
292
|
<title language="en" format="text/plain">Document title</title>
|
@@ -296,11 +310,13 @@ RSpec.describe Asciidoctor::Standoc do
|
|
296
310
|
<p id="_">For further information on the Foreword, see <strong>ISO/IEC Directives, Part 2, 2016, Clause 12.</strong></p></review></sections>
|
297
311
|
</standard-document>
|
298
312
|
|
299
|
-
|
313
|
+
OUTPUT
|
314
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
315
|
+
.to be_equivalent_to xmlpp(output)
|
300
316
|
end
|
301
317
|
|
302
318
|
it "processes term notes" do
|
303
|
-
|
319
|
+
input = <<~INPUT
|
304
320
|
#{ASCIIDOC_BLANK_HDR}
|
305
321
|
== Terms and Definitions
|
306
322
|
|
@@ -312,29 +328,32 @@ RSpec.describe Asciidoctor::Standoc do
|
|
312
328
|
====
|
313
329
|
XYZ
|
314
330
|
====
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
</
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
331
|
+
INPUT
|
332
|
+
output = <<~OUTPUT
|
333
|
+
#{BLANK_HDR}
|
334
|
+
<sections>
|
335
|
+
<terms id="_" obligation="normative">
|
336
|
+
<title>Terms and definitions</title>
|
337
|
+
<p id="_">For the purposes of this document, the following terms and definitions apply.</p>
|
338
|
+
<term id="term-term1">
|
339
|
+
<preferred>Term1</preferred>
|
340
|
+
<termnote id="_">
|
341
|
+
<p id="_">This is a note</p>
|
342
|
+
</termnote>
|
343
|
+
<termnote id='_'>
|
344
|
+
<p id='_'>XYZ</p>
|
345
|
+
</termnote>
|
346
|
+
</term>
|
347
|
+
</terms>
|
348
|
+
</sections>
|
349
|
+
</standard-document>
|
350
|
+
OUTPUT
|
351
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
352
|
+
.to be_equivalent_to xmlpp(output)
|
334
353
|
end
|
335
354
|
|
336
|
-
|
337
|
-
|
355
|
+
it "processes term notes as plain notes in nonterm clauses" do
|
356
|
+
input = <<~INPUT
|
338
357
|
#{ASCIIDOC_BLANK_HDR}
|
339
358
|
== Terms and Definitions
|
340
359
|
|
@@ -348,33 +367,35 @@ RSpec.describe Asciidoctor::Standoc do
|
|
348
367
|
=== Term1
|
349
368
|
|
350
369
|
NOTE: This is a note
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
</
|
360
|
-
|
361
|
-
|
362
|
-
</
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
</
|
368
|
-
</
|
369
|
-
</
|
370
|
-
</
|
371
|
-
</
|
372
|
-
|
373
|
-
|
370
|
+
INPUT
|
371
|
+
output = <<~OUTPUT
|
372
|
+
#{BLANK_HDR}
|
373
|
+
<sections>
|
374
|
+
<terms id="_" obligation="normative">
|
375
|
+
<title>Terms and definitions</title>
|
376
|
+
<p id="_">No terms and definitions are listed in this document.</p>
|
377
|
+
<note id='_'>
|
378
|
+
<p id='_'>This is not a termnote</p>
|
379
|
+
</note>
|
380
|
+
<example id='_'>
|
381
|
+
<p id='_'>This is not a termexample</p>
|
382
|
+
</example>
|
383
|
+
<clause id="_" inline-header="false" obligation="normative">
|
384
|
+
<title>Term1</title>
|
385
|
+
<note id="_">
|
386
|
+
<p id="_">This is a note</p>
|
387
|
+
</note>
|
388
|
+
</clause>
|
389
|
+
</terms>
|
390
|
+
</sections>
|
391
|
+
</standard-document>
|
392
|
+
OUTPUT
|
393
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
394
|
+
.to be_equivalent_to xmlpp(output)
|
374
395
|
end
|
375
396
|
|
376
|
-
|
377
|
-
|
397
|
+
it "processes term notes as plain notes in definitions subclauses of terms & definitions" do
|
398
|
+
input = <<~INPUT
|
378
399
|
#{ASCIIDOC_BLANK_HDR}
|
379
400
|
== Terms and Definitions
|
380
401
|
|
@@ -383,28 +404,30 @@ RSpec.describe Asciidoctor::Standoc do
|
|
383
404
|
=== Symbols
|
384
405
|
|
385
406
|
NOTE: This is a note
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
<
|
391
|
-
<
|
392
|
-
|
393
|
-
</
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
</
|
399
|
-
</
|
400
|
-
</
|
401
|
-
</
|
402
|
-
|
403
|
-
|
407
|
+
INPUT
|
408
|
+
output = <<~OUTPUT
|
409
|
+
#{BLANK_HDR}
|
410
|
+
<sections>
|
411
|
+
<terms id="_" obligation="normative"><title>Terms, definitions and symbols</title>
|
412
|
+
<p id="_">For the purposes of this document, the following terms and definitions apply.</p>
|
413
|
+
<term id="term-term1">
|
414
|
+
<preferred>Term1</preferred>
|
415
|
+
</term>
|
416
|
+
<definitions id="_" obligation="normative" type="symbols">
|
417
|
+
<title>Symbols</title>
|
418
|
+
<note id="_">
|
419
|
+
<p id="_">This is a note</p>
|
420
|
+
</note>
|
421
|
+
</definitions></terms>
|
422
|
+
</sections>
|
423
|
+
</standard-document>
|
424
|
+
OUTPUT
|
425
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
426
|
+
.to be_equivalent_to xmlpp(output)
|
404
427
|
end
|
405
428
|
|
406
|
-
|
407
|
-
|
429
|
+
it "processes notes" do
|
430
|
+
input = <<~INPUT
|
408
431
|
#{ASCIIDOC_BLANK_HDR}
|
409
432
|
NOTE: This is a note
|
410
433
|
|
@@ -417,31 +440,34 @@ RSpec.describe Asciidoctor::Standoc do
|
|
417
440
|
====
|
418
441
|
XYZ
|
419
442
|
====
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
443
|
+
INPUT
|
444
|
+
output = <<~OUTPUT
|
445
|
+
#{BLANK_HDR}
|
446
|
+
<preface><foreword id="_" obligation="informative">
|
447
|
+
<title>Foreword</title>
|
448
|
+
<note id="_">
|
449
|
+
<p id="_">This is a note</p>
|
450
|
+
</note>
|
451
|
+
</foreword></preface><sections>
|
452
|
+
<note id='_' number="7" subsequence="A" keep-with-next="true" keep-lines-together="true" type="classified">
|
453
|
+
<p id='_'>XYZ</p>
|
454
|
+
</note>
|
455
|
+
<clause id="_" inline-header="false" obligation="normative">
|
456
|
+
<title>Clause 1</title>
|
457
|
+
<note id="ABC">
|
458
|
+
<p id="_">This is a note</p>
|
459
|
+
</note>
|
460
|
+
</clause></sections>
|
461
|
+
|
462
|
+
</standard-document>
|
439
463
|
|
440
|
-
|
441
|
-
|
464
|
+
OUTPUT
|
465
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
466
|
+
.to be_equivalent_to xmlpp(output)
|
467
|
+
end
|
442
468
|
|
443
|
-
|
444
|
-
|
469
|
+
it "processes literals" do
|
470
|
+
input = <<~INPUT
|
445
471
|
#{ASCIIDOC_BLANK_HDR}
|
446
472
|
|
447
473
|
[[ABC]]
|
@@ -450,7 +476,8 @@ RSpec.describe Asciidoctor::Standoc do
|
|
450
476
|
<LITERAL>
|
451
477
|
FIGURATIVE
|
452
478
|
....
|
453
|
-
|
479
|
+
INPUT
|
480
|
+
output = <<~OUTPUT
|
454
481
|
#{BLANK_HDR}
|
455
482
|
<sections>
|
456
483
|
<figure id="ABC" keep-with-next="true" keep-lines-together="true">
|
@@ -461,14 +488,17 @@ RSpec.describe Asciidoctor::Standoc do
|
|
461
488
|
</sections>
|
462
489
|
</standard-document>
|
463
490
|
|
464
|
-
|
465
|
-
|
491
|
+
OUTPUT
|
492
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
493
|
+
.to be_equivalent_to xmlpp(output)
|
494
|
+
end
|
466
495
|
|
467
|
-
|
468
|
-
|
496
|
+
it "processes simple admonitions with Asciidoc names" do
|
497
|
+
input = <<~INPUT
|
469
498
|
#{ASCIIDOC_BLANK_HDR}
|
470
499
|
CAUTION: Only use paddy or parboiled rice for the determination of husked rice yield.
|
471
|
-
|
500
|
+
INPUT
|
501
|
+
output = <<~OUTPUT
|
472
502
|
#{BLANK_HDR}
|
473
503
|
<sections>
|
474
504
|
<admonition id="_" type="caution">
|
@@ -477,14 +507,15 @@ RSpec.describe Asciidoctor::Standoc do
|
|
477
507
|
</sections>
|
478
508
|
</standard-document>
|
479
509
|
|
480
|
-
|
481
|
-
|
482
|
-
|
510
|
+
OUTPUT
|
511
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
512
|
+
.to be_equivalent_to xmlpp(output)
|
513
|
+
end
|
483
514
|
|
484
|
-
|
485
|
-
|
515
|
+
it "processes complex admonitions with non-Asciidoc names" do
|
516
|
+
input = <<~INPUT
|
486
517
|
#{ASCIIDOC_BLANK_HDR}
|
487
|
-
|
518
|
+
|
488
519
|
[[ABC]]
|
489
520
|
[CAUTION,type=Safety Precautions,keep-with-next="true",keep-lines-together="true"]
|
490
521
|
.Precautions
|
@@ -495,7 +526,8 @@ RSpec.describe Asciidoctor::Standoc do
|
|
495
526
|
. More than two glasses of orange juice in 24 hours makes them howl in harmony with alarms and sirens.
|
496
527
|
. Celery makes them sad.
|
497
528
|
====
|
498
|
-
|
529
|
+
INPUT
|
530
|
+
output = <<~OUTPUT
|
499
531
|
#{BLANK_HDR}
|
500
532
|
<sections>
|
501
533
|
<admonition id="ABC" type="safety precautions" keep-with-next="true" keep-lines-together="true">
|
@@ -514,11 +546,13 @@ RSpec.describe Asciidoctor::Standoc do
|
|
514
546
|
</sections>
|
515
547
|
</standard-document>
|
516
548
|
|
517
|
-
|
518
|
-
|
549
|
+
OUTPUT
|
550
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
551
|
+
.to be_equivalent_to xmlpp(output)
|
552
|
+
end
|
519
553
|
|
520
|
-
|
521
|
-
|
554
|
+
it "processes term examples" do
|
555
|
+
input = <<~INPUT
|
522
556
|
#{ASCIIDOC_BLANK_HDR}
|
523
557
|
== Terms and Definitions
|
524
558
|
|
@@ -527,26 +561,28 @@ RSpec.describe Asciidoctor::Standoc do
|
|
527
561
|
[[ABC]]
|
528
562
|
[example]
|
529
563
|
This is an example
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
<
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
<termexample id="ABC">
|
540
|
-
|
541
|
-
</termexample></term>
|
542
|
-
</terms>
|
543
|
-
</sections>
|
544
|
-
</standard-document>
|
545
|
-
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
564
|
+
INPUT
|
565
|
+
output = <<~OUTPUT
|
566
|
+
#{BLANK_HDR}
|
567
|
+
<sections>
|
568
|
+
<terms id="_" obligation="normative">
|
569
|
+
<title>Terms and definitions</title>
|
570
|
+
<p id="_">For the purposes of this document, the following terms and definitions apply.</p>
|
571
|
+
<term id="term-term1">
|
572
|
+
<preferred>Term1</preferred>
|
573
|
+
<termexample id="ABC">
|
574
|
+
<p id="_">This is an example</p>
|
575
|
+
</termexample></term>
|
576
|
+
</terms>
|
577
|
+
</sections>
|
578
|
+
</standard-document>
|
579
|
+
OUTPUT
|
580
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
581
|
+
.to be_equivalent_to xmlpp(output)
|
582
|
+
end
|
583
|
+
|
584
|
+
it "processes term examples as plain examples in nonterm clauses" do
|
585
|
+
input = <<~INPUT
|
550
586
|
#{ASCIIDOC_BLANK_HDR}
|
551
587
|
== Terms and Definitions
|
552
588
|
|
@@ -555,26 +591,29 @@ RSpec.describe Asciidoctor::Standoc do
|
|
555
591
|
|
556
592
|
[example]
|
557
593
|
This is an example
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
<
|
564
|
-
|
565
|
-
|
566
|
-
|
567
|
-
|
568
|
-
</
|
569
|
-
</
|
570
|
-
</
|
571
|
-
</
|
572
|
-
</
|
573
|
-
|
574
|
-
|
594
|
+
INPUT
|
595
|
+
output = <<~OUTPUT
|
596
|
+
#{BLANK_HDR}
|
597
|
+
<sections>
|
598
|
+
<terms id="_" obligation="normative">
|
599
|
+
<title>Terms and definitions</title>
|
600
|
+
<p id="_">No terms and definitions are listed in this document.</p>
|
601
|
+
<clause id="_" inline-header="false" obligation="normative">
|
602
|
+
<title>Term1</title>
|
603
|
+
<example id="_">
|
604
|
+
<p id="_">This is an example</p>
|
605
|
+
</example>
|
606
|
+
</clause>
|
607
|
+
</terms>
|
608
|
+
</sections>
|
609
|
+
</standard-document>
|
610
|
+
OUTPUT
|
611
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
612
|
+
.to be_equivalent_to xmlpp(output)
|
613
|
+
end
|
575
614
|
|
576
615
|
it "processes term examples as plain examples in definitions subclauses of terms & definitions" do
|
577
|
-
|
616
|
+
input = <<~INPUT
|
578
617
|
#{ASCIIDOC_BLANK_HDR}
|
579
618
|
== Terms and Definitions
|
580
619
|
|
@@ -584,27 +623,29 @@ RSpec.describe Asciidoctor::Standoc do
|
|
584
623
|
|
585
624
|
[example]
|
586
625
|
This is an example
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
|
591
|
-
<
|
592
|
-
|
593
|
-
</
|
594
|
-
|
595
|
-
|
596
|
-
|
597
|
-
|
598
|
-
</
|
599
|
-
</
|
600
|
-
</
|
601
|
-
</
|
602
|
-
|
626
|
+
INPUT
|
627
|
+
output = <<~OUTPUT
|
628
|
+
#{BLANK_HDR}
|
629
|
+
<sections>
|
630
|
+
<terms id="_" obligation="normative"><title>Terms, definitions and symbols</title>
|
631
|
+
<p id="_">For the purposes of this document, the following terms and definitions apply.</p><term id="term-term1">
|
632
|
+
<preferred>Term1</preferred>
|
633
|
+
</term>
|
634
|
+
<definitions id="_" obligation="normative" type="symbols">
|
635
|
+
<title>Symbols</title>
|
636
|
+
<example id="_">
|
637
|
+
<p id="_">This is an example</p>
|
638
|
+
</example>
|
639
|
+
</definitions></terms>
|
640
|
+
</sections>
|
641
|
+
</standard-document>
|
642
|
+
OUTPUT
|
643
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
644
|
+
.to be_equivalent_to xmlpp(output)
|
603
645
|
end
|
604
646
|
|
605
|
-
|
606
|
-
|
607
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
647
|
+
it "processes examples" do
|
648
|
+
input = <<~INPUT
|
608
649
|
#{ASCIIDOC_BLANK_HDR}
|
609
650
|
|
610
651
|
[[ABC]]
|
@@ -625,7 +666,8 @@ RSpec.describe Asciidoctor::Standoc do
|
|
625
666
|
====
|
626
667
|
This is yet another example
|
627
668
|
====
|
628
|
-
|
669
|
+
INPUT
|
670
|
+
output = <<~OUTPUT
|
629
671
|
#{BLANK_HDR}
|
630
672
|
<sections>
|
631
673
|
<example id="ABC" subsequence="A" keep-with-next='true' keep-lines-together='next'>
|
@@ -636,16 +678,19 @@ RSpec.describe Asciidoctor::Standoc do
|
|
636
678
|
<example id="_" number="3"><p id="_">This is yet another example</p></example>
|
637
679
|
</sections>
|
638
680
|
</standard-document>
|
639
|
-
|
640
|
-
|
681
|
+
OUTPUT
|
682
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
683
|
+
.to be_equivalent_to xmlpp(output)
|
684
|
+
end
|
641
685
|
|
642
|
-
|
643
|
-
|
686
|
+
it "processes preambles" do
|
687
|
+
input = <<~INPUT
|
644
688
|
#{ASCIIDOC_BLANK_HDR}
|
645
689
|
This is a preamble
|
646
690
|
|
647
691
|
== Section 1
|
648
|
-
|
692
|
+
INPUT
|
693
|
+
output = <<~OUTPUT
|
649
694
|
#{BLANK_HDR}
|
650
695
|
<preface><foreword id="_" obligation="informative">
|
651
696
|
<title>Foreword</title>
|
@@ -655,17 +700,20 @@ RSpec.describe Asciidoctor::Standoc do
|
|
655
700
|
<title>Section 1</title>
|
656
701
|
</clause></sections>
|
657
702
|
</standard-document>
|
658
|
-
|
659
|
-
|
703
|
+
OUTPUT
|
704
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
705
|
+
.to be_equivalent_to xmlpp(output)
|
706
|
+
end
|
660
707
|
|
661
|
-
|
662
|
-
|
708
|
+
it "processes preambles with titles" do
|
709
|
+
input = <<~INPUT
|
663
710
|
#{ASCIIDOC_BLANK_HDR}
|
664
711
|
.Preamble
|
665
712
|
This is a preamble
|
666
713
|
|
667
714
|
== Section 1
|
668
|
-
|
715
|
+
INPUT
|
716
|
+
output = <<~OUTPUT
|
669
717
|
#{BLANK_HDR}
|
670
718
|
<preface><foreword id="_" obligation="informative">
|
671
719
|
<title>Foreword</title>
|
@@ -675,11 +723,13 @@ RSpec.describe Asciidoctor::Standoc do
|
|
675
723
|
<title>Section 1</title>
|
676
724
|
</clause></sections>
|
677
725
|
</standard-document>
|
678
|
-
|
679
|
-
|
726
|
+
OUTPUT
|
727
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
728
|
+
.to be_equivalent_to xmlpp(output)
|
729
|
+
end
|
680
730
|
|
681
731
|
it "processes subfigures" do
|
682
|
-
|
732
|
+
input = <<~INPUT
|
683
733
|
#{ASCIIDOC_BLANK_HDR}
|
684
734
|
[[figureC-2]]
|
685
735
|
.Stages of gelatinization
|
@@ -694,27 +744,30 @@ RSpec.describe Asciidoctor::Standoc do
|
|
694
744
|
image::spec/examples/rice_images/rice_image3_3.png[]
|
695
745
|
====
|
696
746
|
INPUT
|
697
|
-
|
698
|
-
|
699
|
-
|
700
|
-
|
701
|
-
|
702
|
-
|
703
|
-
|
704
|
-
|
705
|
-
|
706
|
-
|
707
|
-
|
708
|
-
|
709
|
-
|
710
|
-
|
711
|
-
|
712
|
-
|
747
|
+
output = <<~OUTPUT
|
748
|
+
#{BLANK_HDR}
|
749
|
+
<sections>
|
750
|
+
<figure id="figureC-2"><name>Stages of gelatinization</name><figure id="_">
|
751
|
+
<name>Initial stages: No grains are fully gelatinized (ungelatinized starch granules are visible inside the kernels)</name>
|
752
|
+
<image src="spec/examples/rice_images/rice_image3_1.png" id="_" mimetype="image/png" height="auto" width="auto"/>
|
753
|
+
</figure>
|
754
|
+
<figure id="_">
|
755
|
+
<name>Intermediate stages: Some fully gelatinized kernels are visible</name>
|
756
|
+
<image src="spec/examples/rice_images/rice_image3_2.png" id="_" mimetype="image/png" height="auto" width="auto"/>
|
757
|
+
</figure>
|
758
|
+
<figure id="_">
|
759
|
+
<name>Final stages: All kernels are fully gelatinized</name>
|
760
|
+
<image src="spec/examples/rice_images/rice_image3_3.png" id="_" mimetype="image/png" height="auto" width="auto"/>
|
761
|
+
</figure></figure>
|
762
|
+
</sections>
|
763
|
+
</standard-document>
|
713
764
|
OUTPUT
|
765
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
766
|
+
.to be_equivalent_to xmlpp(output)
|
714
767
|
end
|
715
768
|
|
716
|
-
|
717
|
-
|
769
|
+
it "processes figures within examples" do
|
770
|
+
input = <<~INPUT
|
718
771
|
#{ASCIIDOC_BLANK_HDR}
|
719
772
|
[[figureC-2]]
|
720
773
|
.Stages of gelatinization
|
@@ -731,29 +784,31 @@ RSpec.describe Asciidoctor::Standoc do
|
|
731
784
|
image::spec/examples/rice_images/rice_image3_3.png[]
|
732
785
|
====
|
733
786
|
INPUT
|
734
|
-
|
735
|
-
|
736
|
-
|
737
|
-
|
738
|
-
|
739
|
-
|
740
|
-
|
741
|
-
|
742
|
-
|
743
|
-
|
744
|
-
|
745
|
-
|
746
|
-
|
747
|
-
|
748
|
-
|
749
|
-
|
750
|
-
|
787
|
+
output = <<~OUTPUT
|
788
|
+
#{BLANK_HDR}
|
789
|
+
<sections>
|
790
|
+
<example id="figureC-2"><name>Stages of gelatinization</name><figure id="_">
|
791
|
+
<name>Initial stages: No grains are fully gelatinized (ungelatinized starch granules are visible inside the kernels)</name>
|
792
|
+
<image src="spec/examples/rice_images/rice_image3_1.png" id="_" mimetype="image/png" height="auto" width="auto"/>
|
793
|
+
</figure>
|
794
|
+
<p id="_">Text</p>
|
795
|
+
<figure id="_">
|
796
|
+
<name>Intermediate stages: Some fully gelatinized kernels are visible</name>
|
797
|
+
<image src="spec/examples/rice_images/rice_image3_2.png" id="_" mimetype="image/png" height="auto" width="auto"/>
|
798
|
+
</figure>
|
799
|
+
<figure id="_">
|
800
|
+
<name>Final stages: All kernels are fully gelatinized</name>
|
801
|
+
<image src="spec/examples/rice_images/rice_image3_3.png" id="_" mimetype="image/png" height="auto" width="auto"/>
|
802
|
+
</figure></example>
|
803
|
+
</sections>
|
804
|
+
</standard-document>
|
751
805
|
OUTPUT
|
806
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
807
|
+
.to be_equivalent_to xmlpp(output)
|
752
808
|
end
|
753
809
|
|
754
|
-
|
755
|
-
|
756
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
810
|
+
it "processes images" do
|
811
|
+
input = <<~INPUT
|
757
812
|
#{ASCIIDOC_BLANK_HDR}
|
758
813
|
|
759
814
|
[[ABC]]
|
@@ -761,7 +816,8 @@ RSpec.describe Asciidoctor::Standoc do
|
|
761
816
|
.Split-it-right sample divider
|
762
817
|
image::spec/examples/rice_images/rice_image1.png[alttext]
|
763
818
|
|
764
|
-
|
819
|
+
INPUT
|
820
|
+
output = <<~OUTPUT
|
765
821
|
#{BLANK_HDR}
|
766
822
|
<sections>
|
767
823
|
<figure id="ABC" unnumbered="true" number="3">
|
@@ -770,17 +826,20 @@ RSpec.describe Asciidoctor::Standoc do
|
|
770
826
|
</figure>
|
771
827
|
</sections>
|
772
828
|
</standard-document>
|
773
|
-
|
774
|
-
|
829
|
+
OUTPUT
|
830
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
831
|
+
.to be_equivalent_to xmlpp(output)
|
832
|
+
end
|
775
833
|
|
776
|
-
|
777
|
-
|
834
|
+
it "processes data URI images" do
|
835
|
+
input = <<~INPUT
|
778
836
|
#{ASCIIDOC_BLANK_HDR}
|
779
837
|
[subsequence=A]
|
780
838
|
.Split-it-right sample divider
|
781
839
|
image::data:image/*;base64,iVBORw0KGgoAAAANSUhEUgAAAM4AAAAjCAYAAADcxTWYAAAAAXNSR0IArs4c6QAAExZJREFUeAHtnQmYVcWVx6t3oGn2xRVwQUEQIiKi0YgGVNxmjBCXQcOHkTiaxIwy6mSMqKhJXJKMcUky7kZjBDUoKsEIqIggLsEFUFFAFGSHpmm2Xub3v30LDuW7bwEUP+ed7/u9OudU3br3VtWpqnvfoykYdN2zbgekEccOgZOhNzSHDTAbJsBfYS5sl2wsLHVF9bXu5x/e4w6oWuBWl1RsVz35g3ZtC7TYvNZ90LSju7Hz+a62oMiV1W3atRe0E85evAN1DOLY38GeQR0a3W3hO3A93AL/CXnJt8A3pgUKt/NOruG40WCDZjn2HPgErIzAmAQ7EqS2vryeb4Fd3gLbEzjncdUjzZVPQz8DOkBX6Ai94G7w0g/lOW/k0/9/LVDvClz9N+i2cw2cPbj3B8z9/x79CHgC1hv/W+gXwCnG1x/9QmNnVNXYRfV1rhF7YukZZBj5U+EhaJahbD77K2wBhUxdQSHPN8Wu8Ivho628+u2aFJfUHt898DLcCV+bh9xct092pZnEjfwU0skzZJ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6nRT/VKGflCR4uM9SQz863QNoW0E7kcDgb7oN3YDnoeVnPWmthLmhndS4cC1UQ7fuVZit6PvEyzStxqm2KHgYVWE1in01GY/SIHWeSvm4zU+l1Tj8OXBH9MPCJ3Y9z5y582s0r3zubL0BTVZf35VsgqQUeJUNINOm3BD3GaBe1Br4gua44ijgvL3slTvWM41ed8iBP5hPGp1d5WZ1brzHbblrtHtnrJDeTf/3ZZuOqbZY5U2dezbfAzmiBDVSixxC9sUwZNDpJVoNXBRGtJP75RrbfekmXKHD8S4FUK84s8vU6VNIaCiItw4e2Zs35YeDy0hbuyd378Xsn/tJN6j9KmKGmfHa+BXZeC+QSOHrDMjU+9W9Jw1eT2hPaFUffa4TSH8dI6AeqLyvRS4Fm/OxmCX/dRv/Vh4InL/kW2JUtoH1ctqLRegzotfI/Ew7SqiNpCtqu6dttK/MwrrOOXPRS/nSq/vZwbXaLVS5V58vmWyCnFshlxVHFNZAUNMr3zzbaqqVacVRmuyXFjzu3u678gfkW2JEWyDVwMp3rLgqsAr2h+Kq+dMx0Tfn8fAvs9Bb4P/RCZMfd+bNlAAAAAElFTkSuQmCC[alttext]
|
782
840
|
|
783
|
-
|
841
|
+
INPUT
|
842
|
+
output = <<~OUTPUT
|
784
843
|
#{BLANK_HDR}
|
785
844
|
<sections>
|
786
845
|
<figure id="_" subsequence="A">
|
@@ -789,17 +848,20 @@ RSpec.describe Asciidoctor::Standoc do
|
|
789
848
|
</figure>
|
790
849
|
</sections>
|
791
850
|
</standard-document>
|
792
|
-
|
793
|
-
|
851
|
+
OUTPUT
|
852
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
853
|
+
.to be_equivalent_to xmlpp(output)
|
854
|
+
end
|
794
855
|
|
795
|
-
|
796
|
-
|
856
|
+
it "accepts attributes on images" do
|
857
|
+
input = <<~INPUT
|
797
858
|
#{ASCIIDOC_BLANK_HDR}
|
798
859
|
[height=4,width=3,alt="IMAGE",filename="riceimg1.png",titleattr="TITLE"]
|
799
860
|
.Caption
|
800
861
|
image::spec/examples/rice_images/rice_image1.png[]
|
801
862
|
|
802
|
-
|
863
|
+
INPUT
|
864
|
+
output = <<~OUTPUT
|
803
865
|
#{BLANK_HDR}
|
804
866
|
<sections>
|
805
867
|
<figure id="_"><name>Caption</name>
|
@@ -807,16 +869,19 @@ RSpec.describe Asciidoctor::Standoc do
|
|
807
869
|
</figure>
|
808
870
|
</sections>
|
809
871
|
</standard-document>
|
810
|
-
|
811
|
-
|
872
|
+
OUTPUT
|
873
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
874
|
+
.to be_equivalent_to xmlpp(output)
|
875
|
+
end
|
812
876
|
|
813
|
-
|
814
|
-
|
877
|
+
it "accepts auto for width and height attributes on images" do
|
878
|
+
input = <<~INPUT
|
815
879
|
#{ASCIIDOC_BLANK_HDR}
|
816
880
|
[height=4,width=auto]
|
817
881
|
image::spec/examples/rice_images/rice_image1.png[]
|
818
882
|
|
819
|
-
|
883
|
+
INPUT
|
884
|
+
output = <<~OUTPUT
|
820
885
|
#{BLANK_HDR}
|
821
886
|
<sections>
|
822
887
|
<figure id="_">
|
@@ -824,25 +889,30 @@ RSpec.describe Asciidoctor::Standoc do
|
|
824
889
|
</figure>
|
825
890
|
</sections>
|
826
891
|
</standard-document>
|
827
|
-
|
828
|
-
|
892
|
+
OUTPUT
|
893
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
894
|
+
.to be_equivalent_to xmlpp(output)
|
895
|
+
end
|
829
896
|
|
830
|
-
|
831
|
-
|
897
|
+
it "processes inline images with width and height attributes on images" do
|
898
|
+
input = <<~INPUT
|
832
899
|
#{ASCIIDOC_BLANK_HDR}
|
833
900
|
Hello image:spec/examples/rice_images/rice_image1.png[alt, 4, 3], how are you?
|
834
901
|
|
835
|
-
|
902
|
+
INPUT
|
903
|
+
output = <<~OUTPUT
|
836
904
|
#{BLANK_HDR}
|
837
905
|
<sections>
|
838
906
|
<p id="_">Hello <image src="spec/examples/rice_images/rice_image1.png" id="_" mimetype="image/png" height="3" width="4" alt="alt"/>, how are you?</p>
|
839
907
|
</sections>
|
840
908
|
</standard-document>
|
841
|
-
|
842
|
-
|
909
|
+
OUTPUT
|
910
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
911
|
+
.to be_equivalent_to xmlpp(output)
|
912
|
+
end
|
843
913
|
|
844
|
-
|
845
|
-
|
914
|
+
it "processes images as datauri" do
|
915
|
+
input = <<~INPUT
|
846
916
|
= Document title
|
847
917
|
Author
|
848
918
|
:docfile: test.adoc
|
@@ -853,25 +923,30 @@ RSpec.describe Asciidoctor::Standoc do
|
|
853
923
|
|
854
924
|
.Split-it-right sample divider
|
855
925
|
image::spec/examples/rice_images/rice_image1.png[]
|
856
|
-
|
857
|
-
|
926
|
+
INPUT
|
927
|
+
expect(strip_guid(Asciidoctor.convert(input, *OPTIONS)))
|
928
|
+
.to include '<image src="data:image/png;base64'
|
929
|
+
end
|
858
930
|
|
859
|
-
|
860
|
-
|
931
|
+
it "accepts attributes on paragraphs" do
|
932
|
+
input = <<~INPUT
|
861
933
|
#{ASCIIDOC_BLANK_HDR}
|
862
934
|
[align=right,keep-with-next=true,keep-lines-together=true]
|
863
935
|
This para is right-aligned.
|
864
|
-
|
936
|
+
INPUT
|
937
|
+
output = <<~OUTPUT
|
865
938
|
#{BLANK_HDR}
|
866
939
|
<sections>
|
867
940
|
<p align="right" id="_" keep-with-next="true" keep-lines-together="true">This para is right-aligned.</p>
|
868
941
|
</sections>
|
869
942
|
</standard-document>
|
870
|
-
|
871
|
-
|
943
|
+
OUTPUT
|
944
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
945
|
+
.to be_equivalent_to xmlpp(output)
|
946
|
+
end
|
872
947
|
|
873
|
-
|
874
|
-
|
948
|
+
it "processes blockquotes" do
|
949
|
+
input = <<~INPUT
|
875
950
|
#{ASCIIDOC_BLANK_HDR}
|
876
951
|
|
877
952
|
[[ABC]]
|
@@ -879,7 +954,8 @@ RSpec.describe Asciidoctor::Standoc do
|
|
879
954
|
____
|
880
955
|
Block quotation
|
881
956
|
____
|
882
|
-
|
957
|
+
INPUT
|
958
|
+
output = <<~OUTPUT
|
883
959
|
#{BLANK_HDR}
|
884
960
|
<sections>
|
885
961
|
<quote id="ABC" align="right" keep-with-next="true" keep-lines-together="true">
|
@@ -893,13 +969,15 @@ RSpec.describe Asciidoctor::Standoc do
|
|
893
969
|
</quote>
|
894
970
|
</sections>
|
895
971
|
</standard-document>
|
896
|
-
|
897
|
-
|
972
|
+
OUTPUT
|
973
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
974
|
+
.to be_equivalent_to xmlpp(output)
|
975
|
+
end
|
898
976
|
|
899
|
-
|
900
|
-
|
977
|
+
it "processes source code" do
|
978
|
+
input = <<~INPUT
|
901
979
|
#{ASCIIDOC_BLANK_HDR}
|
902
|
-
|
980
|
+
|
903
981
|
[[ABC]]
|
904
982
|
.Caption
|
905
983
|
[source%unnumbered,ruby,number=3,filename=sourcecode1.rb,keep-with-next=true,keep-lines-together=true]
|
@@ -909,7 +987,8 @@ RSpec.describe Asciidoctor::Standoc do
|
|
909
987
|
puts x
|
910
988
|
end
|
911
989
|
--
|
912
|
-
|
990
|
+
INPUT
|
991
|
+
output = <<~OUTPUT
|
913
992
|
#{BLANK_HDR}
|
914
993
|
<sections>
|
915
994
|
<sourcecode id="ABC" lang="ruby" filename="sourcecode1.rb" unnumbered="true" number="3" keep-with-next="true" keep-lines-together="true">
|
@@ -919,11 +998,13 @@ RSpec.describe Asciidoctor::Standoc do
|
|
919
998
|
end</sourcecode>
|
920
999
|
</sections>
|
921
1000
|
</standard-document>
|
922
|
-
|
923
|
-
|
1001
|
+
OUTPUT
|
1002
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
1003
|
+
.to be_equivalent_to xmlpp(output)
|
1004
|
+
end
|
924
1005
|
|
925
|
-
|
926
|
-
|
1006
|
+
it "processes callouts" do
|
1007
|
+
input = <<~INPUT
|
927
1008
|
#{ASCIIDOC_BLANK_HDR}
|
928
1009
|
[source,ruby]
|
929
1010
|
--
|
@@ -934,7 +1015,8 @@ RSpec.describe Asciidoctor::Standoc do
|
|
934
1015
|
--
|
935
1016
|
<1> This is one callout
|
936
1017
|
<2> This is another callout
|
937
|
-
|
1018
|
+
INPUT
|
1019
|
+
output = <<~OUTPUT
|
938
1020
|
#{BLANK_HDR}
|
939
1021
|
<sections><sourcecode id="_" lang="ruby">puts "Hello, world." <callout target="_">1</callout>
|
940
1022
|
%w{a b c}.each do |x|
|
@@ -946,11 +1028,13 @@ RSpec.describe Asciidoctor::Standoc do
|
|
946
1028
|
</annotation></sourcecode>
|
947
1029
|
</sections>
|
948
1030
|
</standard-document>
|
949
|
-
|
950
|
-
|
1031
|
+
OUTPUT
|
1032
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
1033
|
+
.to be_equivalent_to xmlpp(output)
|
1034
|
+
end
|
951
1035
|
|
952
|
-
|
953
|
-
|
1036
|
+
it "processes unmodified term sources" do
|
1037
|
+
input = <<~INPUT
|
954
1038
|
#{ASCIIDOC_BLANK_HDR}
|
955
1039
|
== Terms and Definitions
|
956
1040
|
|
@@ -967,65 +1051,68 @@ RSpec.describe Asciidoctor::Standoc do
|
|
967
1051
|
Definition
|
968
1052
|
|
969
1053
|
[.source]
|
970
|
-
{{IEV:xyz}}
|
1054
|
+
{{<<IEV:xyz>>}}
|
971
1055
|
|
972
1056
|
[.source]
|
973
|
-
{{IEV:xyz
|
1057
|
+
{{<<IEV:xyz>>,t1}}
|
974
1058
|
|
975
1059
|
[.source]
|
976
|
-
{{IEV:xyz
|
977
|
-
|
978
|
-
|
979
|
-
|
980
|
-
|
981
|
-
|
982
|
-
|
983
|
-
|
984
|
-
|
985
|
-
|
986
|
-
|
987
|
-
|
988
|
-
|
989
|
-
|
990
|
-
|
991
|
-
|
992
|
-
|
993
|
-
|
994
|
-
|
995
|
-
|
996
|
-
|
997
|
-
|
998
|
-
|
999
|
-
|
1000
|
-
|
1001
|
-
|
1002
|
-
|
1003
|
-
|
1004
|
-
|
1005
|
-
|
1006
|
-
|
1007
|
-
|
1008
|
-
|
1009
|
-
|
1010
|
-
|
1011
|
-
|
1012
|
-
|
1013
|
-
|
1014
|
-
|
1015
|
-
|
1016
|
-
|
1017
|
-
|
1018
|
-
|
1019
|
-
|
1020
|
-
</
|
1021
|
-
|
1022
|
-
|
1023
|
-
|
1024
|
-
|
1025
|
-
|
1060
|
+
{{<<IEV:xyz>>,t1,t2}}
|
1061
|
+
INPUT
|
1062
|
+
output = <<~OUTPUT
|
1063
|
+
#{BLANK_HDR}
|
1064
|
+
<sections>
|
1065
|
+
<terms id="_" obligation="normative">
|
1066
|
+
<title>Terms and definitions</title><p id="_">For the purposes of this document,
|
1067
|
+
the following terms and definitions apply.</p>
|
1068
|
+
<term id="term-term1">
|
1069
|
+
<preferred>Term1</preferred>
|
1070
|
+
<termsource status="identical">
|
1071
|
+
<origin bibitemid="ISO2191" type="inline" citeas="">
|
1072
|
+
<localityStack>
|
1073
|
+
<locality type="section"><referenceFrom>1</referenceFrom></locality>
|
1074
|
+
</localityStack>
|
1075
|
+
</origin>
|
1076
|
+
</termsource>
|
1077
|
+
<termsource status="identical">
|
1078
|
+
<origin bibitemid="ISO2191" type="inline" citeas="" case='capital' droploc='true'>
|
1079
|
+
<localityStack>
|
1080
|
+
<locality type="section"><referenceFrom>1</referenceFrom></locality>
|
1081
|
+
</localityStack>
|
1082
|
+
</origin>
|
1083
|
+
</termsource>
|
1084
|
+
</term>
|
1085
|
+
<term id='term-term2'>
|
1086
|
+
<preferred>Term2</preferred>
|
1087
|
+
<definition>
|
1088
|
+
<p id='_'>Definition</p>
|
1089
|
+
</definition>
|
1090
|
+
<termsource status='identical'>
|
1091
|
+
<origin citeas=''>
|
1092
|
+
<termref base='IEV' target='xyz'/>
|
1093
|
+
</origin>
|
1094
|
+
</termsource>
|
1095
|
+
<termsource status='identical'>
|
1096
|
+
<origin citeas=''>
|
1097
|
+
<termref base='IEV' target='xyz'/>
|
1098
|
+
</origin>
|
1099
|
+
</termsource>
|
1100
|
+
<termsource status='identical'>
|
1101
|
+
<origin citeas=''>
|
1102
|
+
<termref base='IEV' target='xyz'/>
|
1103
|
+
</origin>
|
1104
|
+
</termsource>
|
1105
|
+
</term>
|
1106
|
+
</terms>
|
1107
|
+
</sections>
|
1108
|
+
</standard-document>
|
1109
|
+
OUTPUT
|
1110
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
1111
|
+
.to be_equivalent_to xmlpp(output)
|
1112
|
+
end
|
1026
1113
|
|
1027
|
-
|
1028
|
-
|
1114
|
+
it "processes modified term sources" do
|
1115
|
+
input = <<~INPUT
|
1029
1116
|
#{ASCIIDOC_BLANK_HDR}
|
1030
1117
|
== Terms and Definitions
|
1031
1118
|
|
@@ -1039,48 +1126,51 @@ RSpec.describe Asciidoctor::Standoc do
|
|
1039
1126
|
Definition
|
1040
1127
|
|
1041
1128
|
[.source]
|
1042
|
-
{{IEV:xyz}}, with adjustments
|
1043
|
-
|
1044
|
-
|
1045
|
-
|
1046
|
-
|
1047
|
-
|
1048
|
-
|
1049
|
-
|
1050
|
-
|
1051
|
-
|
1052
|
-
|
1053
|
-
|
1054
|
-
|
1055
|
-
|
1056
|
-
|
1057
|
-
|
1058
|
-
|
1059
|
-
|
1060
|
-
|
1061
|
-
|
1062
|
-
|
1063
|
-
|
1064
|
-
|
1065
|
-
|
1066
|
-
|
1067
|
-
|
1068
|
-
|
1069
|
-
|
1070
|
-
|
1071
|
-
|
1072
|
-
|
1073
|
-
|
1074
|
-
|
1075
|
-
|
1076
|
-
</
|
1077
|
-
|
1078
|
-
|
1079
|
-
|
1080
|
-
|
1081
|
-
|
1129
|
+
{{<<IEV:xyz>>}}, with adjustments
|
1130
|
+
INPUT
|
1131
|
+
output = <<~OUTPUT
|
1132
|
+
#{BLANK_HDR}
|
1133
|
+
<sections>
|
1134
|
+
<terms id="_" obligation="normative">
|
1135
|
+
<title>Terms and definitions</title>
|
1136
|
+
<p id="_">For the purposes of this document,
|
1137
|
+
the following terms and definitions apply.</p>
|
1138
|
+
<term id="term-term1">
|
1139
|
+
<preferred>Term1</preferred>
|
1140
|
+
<termsource status="modified">
|
1141
|
+
<origin bibitemid="ISO2191" type="inline" citeas="">
|
1142
|
+
<localityStack>
|
1143
|
+
<locality type="section"><referenceFrom>1</referenceFrom></locality>
|
1144
|
+
</localityStack>
|
1145
|
+
</origin>
|
1146
|
+
<modification>
|
1147
|
+
<p id="_">with adjustments</p>
|
1148
|
+
</modification>
|
1149
|
+
</termsource>
|
1150
|
+
</term>
|
1151
|
+
<term id='term-term2'>
|
1152
|
+
<preferred>Term2</preferred>
|
1153
|
+
<definition>
|
1154
|
+
<p id='_'>Definition</p>
|
1155
|
+
</definition>
|
1156
|
+
<termsource status='modified'>
|
1157
|
+
<origin citeas=''>
|
1158
|
+
<termref base='IEV' target='xyz'/>
|
1159
|
+
</origin>
|
1160
|
+
<modification>
|
1161
|
+
<p id='_'>with adjustments</p>
|
1162
|
+
</modification>
|
1163
|
+
</termsource>
|
1164
|
+
</term>
|
1165
|
+
</terms>
|
1166
|
+
</sections>
|
1167
|
+
</standard-document>
|
1168
|
+
OUTPUT
|
1169
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
1170
|
+
.to be_equivalent_to xmlpp(output)
|
1171
|
+
end
|
1082
1172
|
|
1083
|
-
|
1173
|
+
it "processes recommendation" do
|
1084
1174
|
input = <<~"INPUT"
|
1085
1175
|
#{ASCIIDOC_BLANK_HDR}
|
1086
1176
|
[.recommendation,label="/ogc/recommendation/wfs/2",subject="user",inherit="/ss/584/2015/level/1; /ss/584/2015/level/2",options="unnumbered",type=verification,model=ogc]
|
@@ -1088,24 +1178,25 @@ RSpec.describe Asciidoctor::Standoc do
|
|
1088
1178
|
I recommend this
|
1089
1179
|
====
|
1090
1180
|
INPUT
|
1091
|
-
|
1092
|
-
|
1093
|
-
|
1094
|
-
|
1095
|
-
|
1096
|
-
<subject>user</subject>
|
1097
|
-
<inherit>/ss/584/2015/level/1</inherit>
|
1098
|
-
<inherit>/ss/584/2015/level/2</inherit>
|
1099
|
-
|
1100
|
-
</recommendation>
|
1101
|
-
|
1102
|
-
|
1181
|
+
output = <<~"OUTPUT"
|
1182
|
+
#{BLANK_HDR}
|
1183
|
+
<sections>
|
1184
|
+
<recommendation id="_" unnumbered="true" type="verification" model="ogc">
|
1185
|
+
<label>/ogc/recommendation/wfs/2</label>
|
1186
|
+
<subject>user</subject>
|
1187
|
+
<inherit>/ss/584/2015/level/1</inherit>
|
1188
|
+
<inherit>/ss/584/2015/level/2</inherit>
|
1189
|
+
<description><p id="_">I recommend this</p></description>
|
1190
|
+
</recommendation>
|
1191
|
+
</sections>
|
1192
|
+
</standard-document>
|
1103
1193
|
OUTPUT
|
1104
1194
|
|
1105
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(input,
|
1195
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
1196
|
+
.to be_equivalent_to xmlpp(output)
|
1106
1197
|
end
|
1107
1198
|
|
1108
|
-
|
1199
|
+
it "processes requirement" do
|
1109
1200
|
input = <<~"INPUT"
|
1110
1201
|
#{ASCIIDOC_BLANK_HDR}
|
1111
1202
|
[[ABC]]
|
@@ -1115,22 +1206,23 @@ RSpec.describe Asciidoctor::Standoc do
|
|
1115
1206
|
I recommend this
|
1116
1207
|
====
|
1117
1208
|
INPUT
|
1118
|
-
|
1119
|
-
|
1120
|
-
|
1121
|
-
|
1122
|
-
|
1123
|
-
|
1124
|
-
|
1125
|
-
</requirement>
|
1126
|
-
|
1127
|
-
|
1209
|
+
output = <<~OUTPUT
|
1210
|
+
#{BLANK_HDR}
|
1211
|
+
<sections>
|
1212
|
+
<requirement id="ABC" subsequence="A" number="3" keep-with-next="true" keep-lines-together="true">
|
1213
|
+
<title>Title</title>
|
1214
|
+
<inherit>/ss/584/2015/level/1 & /ss/584/2015/level/2</inherit>
|
1215
|
+
<description><p id="_">I recommend this</p></description>
|
1216
|
+
</requirement>
|
1217
|
+
</sections>
|
1218
|
+
</standard-document>
|
1128
1219
|
OUTPUT
|
1129
1220
|
|
1130
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(input,
|
1221
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
1222
|
+
.to be_equivalent_to xmlpp(output)
|
1131
1223
|
end
|
1132
1224
|
|
1133
|
-
|
1225
|
+
it "processes permission" do
|
1134
1226
|
input = <<~"INPUT"
|
1135
1227
|
#{ASCIIDOC_BLANK_HDR}
|
1136
1228
|
|
@@ -1140,21 +1232,21 @@ RSpec.describe Asciidoctor::Standoc do
|
|
1140
1232
|
I recommend this
|
1141
1233
|
====
|
1142
1234
|
INPUT
|
1143
|
-
|
1144
|
-
|
1145
|
-
|
1146
|
-
|
1147
|
-
|
1148
|
-
</permission>
|
1149
|
-
|
1150
|
-
|
1235
|
+
output = <<~"OUTPUT"
|
1236
|
+
#{BLANK_HDR}
|
1237
|
+
<sections>
|
1238
|
+
<permission id="ABC">
|
1239
|
+
<description><p id="_">I recommend this</p></description>
|
1240
|
+
</permission>
|
1241
|
+
</sections>
|
1242
|
+
</standard-document>
|
1151
1243
|
OUTPUT
|
1152
1244
|
|
1153
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(input,
|
1245
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
1246
|
+
.to be_equivalent_to xmlpp(output)
|
1154
1247
|
end
|
1155
1248
|
|
1156
|
-
|
1157
|
-
it "processes nested permissions" do
|
1249
|
+
it "processes nested permissions" do
|
1158
1250
|
input = <<~"INPUT"
|
1159
1251
|
#{ASCIIDOC_BLANK_HDR}
|
1160
1252
|
[.permission]
|
@@ -1171,24 +1263,25 @@ RSpec.describe Asciidoctor::Standoc do
|
|
1171
1263
|
=====
|
1172
1264
|
====
|
1173
1265
|
INPUT
|
1174
|
-
|
1175
|
-
|
1176
|
-
|
1177
|
-
|
1178
|
-
<example id="_">
|
1179
|
-
|
1180
|
-
</example></description>
|
1181
|
-
<permission id="_">
|
1182
|
-
|
1183
|
-
</permission></permission>
|
1184
|
-
</sections>
|
1185
|
-
</standard-document>
|
1266
|
+
output = <<~"OUTPUT"
|
1267
|
+
#{BLANK_HDR}
|
1268
|
+
<sections>
|
1269
|
+
<permission id="_"><description><p id="_">I permit this</p>
|
1270
|
+
<example id="_">
|
1271
|
+
<p id="_">Example 2</p>
|
1272
|
+
</example></description>
|
1273
|
+
<permission id="_">
|
1274
|
+
<description><p id="_">I also permit this</p></description>
|
1275
|
+
</permission></permission>
|
1276
|
+
</sections>
|
1277
|
+
</standard-document>
|
1186
1278
|
OUTPUT
|
1187
1279
|
|
1188
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(input,
|
1280
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
1281
|
+
.to be_equivalent_to xmlpp(output)
|
1189
1282
|
end
|
1190
1283
|
|
1191
|
-
|
1284
|
+
it "processes recommendation with internal markup of structure" do
|
1192
1285
|
input = <<~"INPUT"
|
1193
1286
|
#{ASCIIDOC_BLANK_HDR}
|
1194
1287
|
|
@@ -1204,7 +1297,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
1204
1297
|
|Object |Value
|
1205
1298
|
|Mission | Accomplished
|
1206
1299
|
|===
|
1207
|
-
--
|
1300
|
+
--
|
1208
1301
|
|
1209
1302
|
As for the measurement targets,
|
1210
1303
|
|
@@ -1229,7 +1322,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
1229
1322
|
end
|
1230
1323
|
----
|
1231
1324
|
--
|
1232
|
-
|
1325
|
+
|
1233
1326
|
[.import%exclude]
|
1234
1327
|
--
|
1235
1328
|
[source,CoreRoot]
|
@@ -1239,167 +1332,167 @@ RSpec.describe Asciidoctor::Standoc do
|
|
1239
1332
|
--
|
1240
1333
|
====
|
1241
1334
|
INPUT
|
1242
|
-
|
1243
|
-
|
1244
|
-
|
1245
|
-
|
1246
|
-
<classification><tag>control-class</tag><value>Technical</value></classification><classification><tag>priority</tag><value>P0</value></classification><classification><tag>family</tag><value>System & Communications Protection</value></classification><classification><tag>family</tag><value>System and Communications Protocols</value></classification>
|
1247
|
-
|
1248
|
-
|
1249
|
-
|
1250
|
-
|
1251
|
-
|
1252
|
-
|
1253
|
-
</mrow>
|
1254
|
-
<mrow>
|
1255
|
-
|
1256
|
-
</mrow>
|
1257
|
-
</mfrac><mo>=</mo><mn>0</mn></math></stem></formula></measurement-target>
|
1258
|
-
|
1259
|
-
if (success)
|
1260
|
-
|
1261
|
-
end</sourcecode></verification>
|
1262
|
-
|
1263
|
-
|
1264
|
-
|
1335
|
+
output = <<~"OUTPUT"
|
1336
|
+
#{BLANK_HDR}
|
1337
|
+
<sections>
|
1338
|
+
<recommendation id="ABC" obligation="permission,recommendation" filename="reqt1.rq"><label>/ogc/recommendation/wfs/2</label><subject>user</subject>
|
1339
|
+
<classification><tag>control-class</tag><value>Technical</value></classification><classification><tag>priority</tag><value>P0</value></classification><classification><tag>family</tag><value>System & Communications Protection</value></classification><classification><tag>family</tag><value>System and Communications Protocols</value></classification>
|
1340
|
+
<description><p id="_">I recommend <em>this</em>.</p>
|
1341
|
+
</description><specification exclude="false" type="tabular" keep-with-next="true" keep-lines-together="true"><p id="_">This is the object of the recommendation:</p><table id="_"> <tbody> <tr> <td valign="top" align="left">Object</td> <td valign="top" align="left">Value</td> </tr> <tr> <td valign="top" align="left">Mission</td> <td valign="top" align="left">Accomplished</td> </tr> </tbody></table></specification><description>
|
1342
|
+
<p id="_">As for the measurement targets,</p>
|
1343
|
+
</description><measurement-target exclude="false"><p id="_">The measurement target shall be measured as:</p><formula id="_"> <stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><mfrac>
|
1344
|
+
<mrow>
|
1345
|
+
<mi>r</mi>
|
1346
|
+
</mrow>
|
1347
|
+
<mrow>
|
1348
|
+
<mn>1</mn>
|
1349
|
+
</mrow>
|
1350
|
+
</mfrac><mo>=</mo><mn>0</mn></math></stem></formula></measurement-target>
|
1351
|
+
<verification exclude="false"><p id="_">The following code will be run for verification:</p><sourcecode lang="CoreRoot" id="_">CoreRoot(success): HttpResponse
|
1352
|
+
if (success)
|
1353
|
+
recommendation(label: success-response)
|
1354
|
+
end</sourcecode></verification>
|
1355
|
+
<import exclude="true"> <sourcecode lang="CoreRoot" id="_">success-response()</sourcecode></import></recommendation>
|
1356
|
+
</sections>
|
1357
|
+
</standard-document>
|
1265
1358
|
OUTPUT
|
1266
1359
|
|
1267
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(input,
|
1360
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
1361
|
+
.to be_equivalent_to xmlpp(output)
|
1268
1362
|
end
|
1269
1363
|
|
1270
1364
|
it "processes delete change clauses" do
|
1271
1365
|
input = <<~"INPUT"
|
1272
|
-
#{ASCIIDOC_BLANK_HDR}
|
1273
|
-
[change="modify",locality="page=27",path="//table[2]",path_end="//table[2]/following-sibling:example[1]",title="Change"]
|
1274
|
-
==== Change Clause
|
1275
|
-
_This table contains information on polygon cells which are not included in ISO 10303-52. Remove table 2 completely and replace with:_
|
1276
|
-
INPUT
|
1277
|
-
|
1278
|
-
|
1279
|
-
|
1280
|
-
|
1281
|
-
|
1282
|
-
|
1283
|
-
|
1284
|
-
|
1285
|
-
|
1286
|
-
|
1287
|
-
|
1288
|
-
|
1289
|
-
|
1290
|
-
|
1291
|
-
|
1292
|
-
|
1293
|
-
|
1294
|
-
</sections>
|
1295
|
-
|
1296
|
-
|
1297
|
-
|
1298
|
-
|
1366
|
+
#{ASCIIDOC_BLANK_HDR}
|
1367
|
+
[change="modify",locality="page=27",path="//table[2]",path_end="//table[2]/following-sibling:example[1]",title="Change"]
|
1368
|
+
==== Change Clause
|
1369
|
+
_This table contains information on polygon cells which are not included in ISO 10303-52. Remove table 2 completely and replace with:_
|
1370
|
+
INPUT
|
1371
|
+
output = <<~"OUTPUT"
|
1372
|
+
#{BLANK_HDR}
|
1373
|
+
<sections>
|
1374
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
1375
|
+
<title>Change Clause</title>
|
1376
|
+
<amend id='_' change='modify' path='//table[2]' path_end='//table[2]/following-sibling:example[1]' title='Change'>
|
1377
|
+
<description>
|
1378
|
+
<p id='_'>
|
1379
|
+
<em>
|
1380
|
+
This table contains information on polygon cells which are not
|
1381
|
+
included in ISO 10303-52. Remove table 2 completely and replace
|
1382
|
+
with:
|
1383
|
+
</em>
|
1384
|
+
</p>
|
1385
|
+
</description>
|
1386
|
+
</amend>
|
1387
|
+
</clause>
|
1388
|
+
</sections>
|
1389
|
+
</standard-document>
|
1390
|
+
OUTPUT
|
1391
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
1392
|
+
.to be_equivalent_to xmlpp(output)
|
1299
1393
|
end
|
1300
1394
|
|
1301
1395
|
it "processes modify change clauses" do
|
1302
1396
|
input = <<~"INPUT"
|
1303
|
-
#{ASCIIDOC_BLANK_HDR}
|
1304
|
-
[change="modify",locality="page=27",path="//table[2]",path_end="//table[2]/following-sibling:example[1]",title="Change"]
|
1305
|
-
==== Change Clause
|
1397
|
+
#{ASCIIDOC_BLANK_HDR}
|
1398
|
+
[change="modify",locality="page=27",path="//table[2]",path_end="//table[2]/following-sibling:example[1]",title="Change"]
|
1399
|
+
==== Change Clause
|
1306
1400
|
|
1307
|
-
autonumber:table[2]
|
1308
|
-
autonumber:note[7]
|
1401
|
+
autonumber:table[2]
|
1402
|
+
autonumber:note[7]
|
1309
1403
|
|
1310
|
-
_This table contains information on polygon cells which are not included in ISO 10303-52. Remove table 2 completely and replace with:_
|
1404
|
+
_This table contains information on polygon cells which are not included in ISO 10303-52. Remove table 2 completely and replace with:_
|
1311
1405
|
|
1312
|
-
____
|
1313
|
-
.Edges of triangle and quadrilateral cells
|
1314
|
-
|===
|
1315
|
-
2+^.^h| triangle 2+^.^h| quadrilateral
|
1316
|
-
^.^| edge ^.^| vertices ^.^| edge ^.^| vertices
|
1317
|
-
^.^| 1 ^.^| 1, 2 ^.^| 1 ^.^| 1, 2
|
1318
|
-
^.^| 2 ^.^| 2, 3 ^.^| 2 ^.^| 2, 3
|
1319
|
-
^.^| 3 ^.^| 3, 1 ^.^| 3 ^.^| 3, 4
|
1320
|
-
| | ^.^| 4 ^.^| 4, 1
|
1321
|
-
|===
|
1406
|
+
____
|
1407
|
+
.Edges of triangle and quadrilateral cells
|
1408
|
+
|===
|
1409
|
+
2+^.^h| triangle 2+^.^h| quadrilateral
|
1410
|
+
^.^| edge ^.^| vertices ^.^| edge ^.^| vertices
|
1411
|
+
^.^| 1 ^.^| 1, 2 ^.^| 1 ^.^| 1, 2
|
1412
|
+
^.^| 2 ^.^| 2, 3 ^.^| 2 ^.^| 2, 3
|
1413
|
+
^.^| 3 ^.^| 3, 1 ^.^| 3 ^.^| 3, 4
|
1414
|
+
| | ^.^| 4 ^.^| 4, 1
|
1415
|
+
|===
|
1322
1416
|
|
1323
|
-
====
|
1324
|
-
This is not generalised further.
|
1325
|
-
====
|
1417
|
+
====
|
1418
|
+
This is not generalised further.
|
1419
|
+
====
|
1326
1420
|
|
1327
|
-
____
|
1421
|
+
____
|
1328
1422
|
|
1329
|
-
Any further exceptions can be ignored.
|
1423
|
+
Any further exceptions can be ignored.
|
1330
1424
|
INPUT
|
1331
1425
|
|
1332
|
-
|
1333
|
-
|
1334
|
-
|
1335
|
-
|
1336
|
-
|
1337
|
-
|
1338
|
-
|
1339
|
-
|
1340
|
-
|
1341
|
-
|
1342
|
-
|
1343
|
-
|
1344
|
-
|
1345
|
-
|
1346
|
-
|
1347
|
-
|
1348
|
-
|
1349
|
-
|
1350
|
-
|
1351
|
-
|
1352
|
-
|
1353
|
-
|
1354
|
-
|
1355
|
-
|
1356
|
-
|
1357
|
-
|
1358
|
-
|
1359
|
-
|
1360
|
-
|
1361
|
-
|
1362
|
-
|
1363
|
-
|
1364
|
-
|
1365
|
-
|
1366
|
-
|
1367
|
-
|
1368
|
-
|
1369
|
-
|
1370
|
-
|
1371
|
-
|
1372
|
-
|
1373
|
-
|
1374
|
-
|
1375
|
-
|
1376
|
-
|
1377
|
-
|
1378
|
-
|
1379
|
-
|
1380
|
-
|
1381
|
-
|
1382
|
-
|
1383
|
-
|
1384
|
-
|
1385
|
-
|
1386
|
-
|
1387
|
-
|
1388
|
-
|
1389
|
-
|
1390
|
-
|
1391
|
-
|
1392
|
-
|
1393
|
-
|
1394
|
-
|
1395
|
-
</description>
|
1396
|
-
|
1397
|
-
|
1398
|
-
</sections>
|
1399
|
-
|
1400
|
-
|
1401
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(input,
|
1426
|
+
output = <<~"OUTPUT"
|
1427
|
+
#{BLANK_HDR}
|
1428
|
+
<sections>
|
1429
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
1430
|
+
<title>Change Clause</title>
|
1431
|
+
<amend id='_' change='modify' path='//table[2]' path_end='//table[2]/following-sibling:example[1]' title='Change'>
|
1432
|
+
<autonumber type='table'>2</autonumber>
|
1433
|
+
<autonumber type='note'>7</autonumber>
|
1434
|
+
<description>
|
1435
|
+
<p id='_'>
|
1436
|
+
<em>
|
1437
|
+
This table contains information on polygon cells which are not
|
1438
|
+
included in ISO 10303-52. Remove table 2 completely and replace
|
1439
|
+
with:
|
1440
|
+
</em>
|
1441
|
+
</p>
|
1442
|
+
</description>
|
1443
|
+
<newcontent id='_'>
|
1444
|
+
<table id='_'>
|
1445
|
+
<name>Edges of triangle and quadrilateral cells</name>
|
1446
|
+
<tbody>
|
1447
|
+
<tr>
|
1448
|
+
<th colspan='2' valign='middle' align='center'>triangle</th>
|
1449
|
+
<th colspan='2' valign='middle' align='center'>quadrilateral</th>
|
1450
|
+
</tr>
|
1451
|
+
<tr>
|
1452
|
+
<td valign='middle' align='center'>edge</td>
|
1453
|
+
<td valign='middle' align='center'>vertices</td>
|
1454
|
+
<td valign='middle' align='center'>edge</td>
|
1455
|
+
<td valign='middle' align='center'>vertices</td>
|
1456
|
+
</tr>
|
1457
|
+
<tr>
|
1458
|
+
<td valign='middle' align='center'>1</td>
|
1459
|
+
<td valign='middle' align='center'>1, 2</td>
|
1460
|
+
<td valign='middle' align='center'>1</td>
|
1461
|
+
<td valign='middle' align='center'>1, 2</td>
|
1462
|
+
</tr>
|
1463
|
+
<tr>
|
1464
|
+
<td valign='middle' align='center'>2</td>
|
1465
|
+
<td valign='middle' align='center'>2, 3</td>
|
1466
|
+
<td valign='middle' align='center'>2</td>
|
1467
|
+
<td valign='middle' align='center'>2, 3</td>
|
1468
|
+
</tr>
|
1469
|
+
<tr>
|
1470
|
+
<td valign='middle' align='center'>3</td>
|
1471
|
+
<td valign='middle' align='center'>3, 1</td>
|
1472
|
+
<td valign='middle' align='center'>3</td>
|
1473
|
+
<td valign='middle' align='center'>3, 4</td>
|
1474
|
+
</tr>
|
1475
|
+
<tr>
|
1476
|
+
<td valign='top' align='left'/>
|
1477
|
+
<td valign='top' align='left'/>
|
1478
|
+
<td valign='middle' align='center'>4</td>
|
1479
|
+
<td valign='middle' align='center'>4, 1</td>
|
1480
|
+
</tr>
|
1481
|
+
</tbody>
|
1482
|
+
</table>
|
1483
|
+
<example id='_'>
|
1484
|
+
<p id='_'>This is not generalised further.</p>
|
1485
|
+
</example>
|
1486
|
+
</newcontent>
|
1487
|
+
<description>
|
1488
|
+
<p id='_'>Any further exceptions can be ignored.</p>
|
1489
|
+
</description>
|
1490
|
+
</amend>
|
1491
|
+
</clause>
|
1492
|
+
</sections>
|
1493
|
+
</standard-document>
|
1494
|
+
OUTPUT
|
1495
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
1496
|
+
.to be_equivalent_to xmlpp(output)
|
1402
1497
|
end
|
1403
|
-
|
1404
|
-
|
1405
1498
|
end
|