metanorma-standoc 1.8.8 → 1.9.4
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 +3 -7
- data/Gemfile.devel +0 -0
- data/lib/asciidoctor/standoc/base.rb +42 -36
- 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 +51 -29
- data/lib/asciidoctor/standoc/cleanup_footnotes.rb +1 -0
- data/lib/asciidoctor/standoc/cleanup_image.rb +71 -0
- data/lib/asciidoctor/standoc/cleanup_maths.rb +36 -27
- data/lib/asciidoctor/standoc/cleanup_ref.rb +24 -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 -134
- data/lib/asciidoctor/standoc/cleanup_section_names.rb +75 -0
- data/lib/asciidoctor/standoc/converter.rb +10 -3
- 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 +30 -22
- data/lib/asciidoctor/standoc/isodoc.rng +321 -4
- data/lib/asciidoctor/standoc/lists.rb +4 -2
- data/lib/asciidoctor/standoc/macros.rb +50 -23
- data/lib/asciidoctor/standoc/macros_form.rb +63 -0
- 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 +31 -16
- data/lib/asciidoctor/standoc/terms.rb +27 -16
- data/lib/asciidoctor/standoc/utils.rb +35 -9
- data/lib/asciidoctor/standoc/validate.rb +30 -28
- data/lib/metanorma-standoc.rb +0 -1
- data/lib/metanorma/standoc/version.rb +5 -5
- data/metanorma-standoc.gemspec +11 -11
- data/spec/asciidoctor/base_spec.rb +715 -509
- data/spec/asciidoctor/blocks_spec.rb +830 -727
- data/spec/asciidoctor/cleanup_sections_spec.rb +51 -14
- data/spec/asciidoctor/cleanup_spec.rb +1836 -1673
- data/spec/asciidoctor/inline_spec.rb +330 -283
- data/spec/asciidoctor/isobib_cache_spec.rb +406 -358
- data/spec/asciidoctor/lists_spec.rb +3 -3
- data/spec/asciidoctor/macros_plantuml_spec.rb +8 -8
- data/spec/asciidoctor/macros_spec.rb +546 -444
- 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 +778 -689
- data/spec/asciidoctor/table_spec.rb +6 -6
- data/spec/asciidoctor/validate_spec.rb +296 -304
- data/spec/spec_helper.rb +13 -9
- data/spec/vcr_cassettes/dated_iso_ref_joint_iso_iec.yml +66 -66
- data/spec/vcr_cassettes/isobib_get_123.yml +17 -17
- data/spec/vcr_cassettes/isobib_get_123_1.yml +31 -31
- data/spec/vcr_cassettes/isobib_get_123_1_fr.yml +40 -40
- data/spec/vcr_cassettes/isobib_get_123_2001.yml +17 -17
- data/spec/vcr_cassettes/isobib_get_124.yml +16 -16
- data/spec/vcr_cassettes/rfcbib_get_rfc8341.yml +14 -14
- data/spec/vcr_cassettes/separates_iev_citations_by_top_level_clause.yml +78 -66
- metadata +69 -67
- 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
@@ -1,42 +1,45 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
|
3
3
|
RSpec.describe Asciidoctor::Standoc do
|
4
|
-
|
5
|
-
|
4
|
+
it "handles spacing around markup" do
|
5
|
+
input = <<~INPUT
|
6
6
|
#{ASCIIDOC_BLANK_HDR}
|
7
7
|
This is
|
8
8
|
a paragraph with <<x>>
|
9
9
|
markup _for_
|
10
10
|
text, including **__nest__**ed markup.
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
<
|
15
|
-
<
|
16
|
-
<language>
|
17
|
-
<
|
18
|
-
<
|
19
|
-
<
|
20
|
-
</
|
21
|
-
|
22
|
-
<
|
23
|
-
</
|
24
|
-
|
25
|
-
<
|
26
|
-
</
|
27
|
-
</
|
28
|
-
|
29
|
-
<
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
</
|
34
|
-
</
|
35
|
-
|
11
|
+
INPUT
|
12
|
+
output = <<~OUTPUT
|
13
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
14
|
+
<standard-document xmlns="https://www.metanorma.org/ns/standoc" type="semantic" version="#{Metanorma::Standoc::VERSION}">
|
15
|
+
<bibdata type="standard">
|
16
|
+
<title language="en" format="text/plain">Document title</title>
|
17
|
+
<language>en</language>
|
18
|
+
<script>Latn</script>
|
19
|
+
<status>
|
20
|
+
<stage>published</stage>
|
21
|
+
</status>
|
22
|
+
<copyright>
|
23
|
+
<from>#{Date.today.year}</from>
|
24
|
+
</copyright>
|
25
|
+
<ext>
|
26
|
+
<doctype>article</doctype>
|
27
|
+
</ext>
|
28
|
+
</bibdata>
|
29
|
+
<sections>
|
30
|
+
<p id="_">This is
|
31
|
+
a paragraph with <xref target="x"/>
|
32
|
+
markup <em>for</em>
|
33
|
+
text, including <strong><em>nest</em></strong>ed markup.</p>
|
34
|
+
</sections>
|
35
|
+
</standard-document>
|
36
|
+
OUTPUT
|
37
|
+
expect((strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
38
|
+
.to be_equivalent_to(output)
|
36
39
|
end
|
37
40
|
|
38
41
|
it "processes inline_quoted formatting" do
|
39
|
-
|
42
|
+
input = <<~INPUT
|
40
43
|
#{DUMBQUOTE_BLANK_HDR}
|
41
44
|
_Physical noise
|
42
45
|
sources_
|
@@ -57,187 +60,203 @@ text, including <strong><em>nest</em></strong>ed markup.</p>
|
|
57
60
|
[smallcap]#smallcap#
|
58
61
|
[keyword]#keyword#
|
59
62
|
INPUT
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
63
|
+
output = <<~OUTPUT
|
64
|
+
#{BLANK_HDR}
|
65
|
+
<sections>
|
66
|
+
<em>Physical noise sources</em>
|
67
|
+
<strong>strong</strong>
|
68
|
+
<tt>monospace</tt>
|
69
|
+
"double quote"
|
70
|
+
'single quote'
|
71
|
+
super<sup>script</sup>
|
72
|
+
sub<sub>script</sub>
|
73
|
+
sub<sub><em>scr</em>ipt</sub>
|
74
|
+
<stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><msub> <mrow> <mrow> <mi mathvariant="bold-italic">F</mi> </mrow> </mrow> <mrow> <mrow> <mi mathvariant="bold-italic">Α</mi> </mrow> </mrow> </msub> </math></stem>
|
75
|
+
mark
|
76
|
+
<admitted>alt</admitted>
|
77
|
+
<deprecates>deprecated</deprecates>
|
78
|
+
<domain>domain</domain>
|
79
|
+
<strike>strike</strike>
|
80
|
+
<underline>underline</underline>
|
81
|
+
<smallcap>smallcap</smallcap>
|
82
|
+
<keyword>keyword</keyword>
|
83
|
+
</sections>
|
84
|
+
</standard-document>
|
81
85
|
OUTPUT
|
86
|
+
expect((strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
87
|
+
.to be_equivalent_to(output)
|
82
88
|
end
|
83
89
|
|
84
90
|
it "process mtext spaces" do
|
85
|
-
|
91
|
+
input = <<~INPUT
|
86
92
|
#{DUMBQUOTE_BLANK_HDR}
|
87
93
|
|
88
94
|
stem:[n < 1 " for all text "]
|
89
|
-
INPUT
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
</
|
104
|
-
|
95
|
+
INPUT
|
96
|
+
output = <<~OUTPUT
|
97
|
+
#{BLANK_HDR}
|
98
|
+
<sections>
|
99
|
+
<p id='_'>
|
100
|
+
<stem type='MathML'>
|
101
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
102
|
+
<mi>n</mi>
|
103
|
+
<mo/>
|
104
|
+
<mn>1</mn>
|
105
|
+
<mtext> for all text </mtext>
|
106
|
+
</math>
|
107
|
+
</stem>
|
108
|
+
</p>
|
109
|
+
</sections>
|
110
|
+
</standard-document>
|
111
|
+
OUTPUT
|
112
|
+
expect((strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
113
|
+
.to be_equivalent_to(output)
|
105
114
|
end
|
106
115
|
|
107
116
|
it "properly handles inline substitution" do
|
108
|
-
|
117
|
+
input = <<~INPUT
|
109
118
|
#{DUMBQUOTE_BLANK_HDR}
|
110
119
|
|
111
120
|
stem:[n < 1] +
|
112
121
|
latexmath:[n < 1]
|
113
122
|
stem:["‌"^199 "Hg"^+]
|
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
|
-
|
123
|
+
INPUT
|
124
|
+
output = <<~OUTPUT
|
125
|
+
#{BLANK_HDR}
|
126
|
+
<sections>
|
127
|
+
<p id="_">
|
128
|
+
<stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>n</mi><mo><</mo><mn>1</mn></math></stem><br/>
|
129
|
+
<stem type="MathML"> <math xmlns="http://www.w3.org/1998/Math/MathML"> <mrow> <mi>n</mi> <mo><</mo> <mn>1</mn> </mrow> </math></stem>
|
130
|
+
<stem type='MathML'>
|
131
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
132
|
+
<msup>
|
133
|
+
<mrow>
|
134
|
+
<mtext></mtext>
|
135
|
+
</mrow>
|
136
|
+
<mrow>
|
137
|
+
<mn>199</mn>
|
138
|
+
</mrow>
|
139
|
+
</msup>
|
140
|
+
<msup>
|
141
|
+
<mrow>
|
142
|
+
<mtext>Hg</mtext>
|
143
|
+
</mrow>
|
144
|
+
<mrow>
|
145
|
+
<mo>+</mo>
|
146
|
+
</mrow>
|
147
|
+
</msup>
|
148
|
+
</math>
|
149
|
+
</stem>
|
150
|
+
</p>
|
151
|
+
</sections>
|
152
|
+
</standard-document>
|
153
|
+
OUTPUT
|
154
|
+
expect((strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
155
|
+
.to be_equivalent_to(output)
|
144
156
|
end
|
145
157
|
|
146
158
|
it "normalises inline stem, straight quotes" do
|
147
|
-
|
159
|
+
input = <<~INPUT
|
148
160
|
#{DUMBQUOTE_BLANK_HDR}
|
149
161
|
|
150
162
|
stem:[n < 1]
|
151
163
|
latexmath:[n < 1]
|
152
164
|
stem:["‌"^199 "Hg"^+]
|
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
|
-
|
165
|
+
INPUT
|
166
|
+
output = <<~OUTPUT
|
167
|
+
#{BLANK_HDR}
|
168
|
+
<sections>
|
169
|
+
<p id="_">
|
170
|
+
<stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>n</mi><mo><</mo><mn>1</mn></math></stem>
|
171
|
+
<stem type="MathML"> <math xmlns="http://www.w3.org/1998/Math/MathML"> <mrow> <mi>n</mi> <mo><</mo> <mn>1</mn> </mrow> </math></stem>
|
172
|
+
<stem type='MathML'>
|
173
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
174
|
+
<msup>
|
175
|
+
<mrow>
|
176
|
+
<mtext></mtext>
|
177
|
+
</mrow>
|
178
|
+
<mrow>
|
179
|
+
<mn>199</mn>
|
180
|
+
</mrow>
|
181
|
+
</msup>
|
182
|
+
<msup>
|
183
|
+
<mrow>
|
184
|
+
<mtext>Hg</mtext>
|
185
|
+
</mrow>
|
186
|
+
<mrow>
|
187
|
+
<mo>+</mo>
|
188
|
+
</mrow>
|
189
|
+
</msup>
|
190
|
+
</math>
|
191
|
+
</stem>
|
192
|
+
</p>
|
193
|
+
</sections>
|
194
|
+
</standard-document>
|
195
|
+
OUTPUT
|
196
|
+
expect((strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
197
|
+
.to be_equivalent_to(output)
|
183
198
|
end
|
184
199
|
|
185
200
|
it "normalises inline stem, smart quotes" do
|
186
|
-
|
201
|
+
input = <<~INPUT
|
187
202
|
#{ASCIIDOC_BLANK_HDR}
|
188
203
|
|
189
204
|
stem:[n < 1]
|
190
205
|
latexmath:[n < 1]
|
191
206
|
stem:["‌"^199 "Hg"^+]
|
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
|
-
|
207
|
+
INPUT
|
208
|
+
output = <<~OUTPUT
|
209
|
+
#{BLANK_HDR}
|
210
|
+
<sections>
|
211
|
+
<p id="_">
|
212
|
+
<stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>n</mi><mo><</mo><mn>1</mn></math></stem>
|
213
|
+
<stem type="MathML"> <math xmlns="http://www.w3.org/1998/Math/MathML"> <mrow> <mi>n</mi> <mo><</mo> <mn>1</mn> </mrow> </math></stem>
|
214
|
+
<stem type='MathML'>
|
215
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
216
|
+
<msup>
|
217
|
+
<mrow>
|
218
|
+
<mtext></mtext>
|
219
|
+
</mrow>
|
220
|
+
<mrow>
|
221
|
+
<mn>199</mn>
|
222
|
+
</mrow>
|
223
|
+
</msup>
|
224
|
+
<msup>
|
225
|
+
<mrow>
|
226
|
+
<mtext>Hg</mtext>
|
227
|
+
</mrow>
|
228
|
+
<mrow>
|
229
|
+
<mo>+</mo>
|
230
|
+
</mrow>
|
231
|
+
</msup>
|
232
|
+
</math>
|
233
|
+
</stem>
|
234
|
+
</p>
|
235
|
+
</sections>
|
236
|
+
</standard-document>
|
237
|
+
OUTPUT
|
238
|
+
expect((strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
239
|
+
.to be_equivalent_to(output)
|
222
240
|
end
|
223
241
|
|
224
|
-
|
225
242
|
it "generates desired smart quotes for 'dd'" do
|
226
|
-
|
243
|
+
input = <<~INPUT
|
227
244
|
#{ASCIIDOC_BLANK_HDR}
|
228
245
|
'99'.
|
229
246
|
|
230
247
|
INPUT
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
248
|
+
output = <<~OUTPUT
|
249
|
+
#{BLANK_HDR}
|
250
|
+
<sections><p id="_">‘99’.</p>
|
251
|
+
</sections>
|
252
|
+
</standard-document>
|
235
253
|
OUTPUT
|
254
|
+
expect((strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
255
|
+
.to be_equivalent_to(output)
|
236
256
|
end
|
237
257
|
|
238
|
-
|
239
258
|
it "processes breaks" do
|
240
|
-
|
259
|
+
input = <<~INPUT
|
241
260
|
#{ASCIIDOC_BLANK_HDR}
|
242
261
|
Line break +
|
243
262
|
line break
|
@@ -252,55 +271,70 @@ OUTPUT
|
|
252
271
|
[%portrait]
|
253
272
|
<<<
|
254
273
|
INPUT
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
</
|
274
|
+
output = <<~OUTPUT
|
275
|
+
#{BLANK_HDR}
|
276
|
+
<sections><p id="_">Line break<br/>
|
277
|
+
line break</p>
|
278
|
+
<hr/>
|
279
|
+
<pagebreak/>
|
280
|
+
<pagebreak orientation="landscape"/>
|
281
|
+
<pagebreak orientation="portrait"/>
|
282
|
+
</sections>
|
283
|
+
</standard-document>
|
264
284
|
OUTPUT
|
285
|
+
expect((strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
286
|
+
.to be_equivalent_to(output)
|
265
287
|
end
|
266
288
|
|
267
289
|
it "processes links" do
|
268
|
-
|
290
|
+
input = <<~INPUT
|
269
291
|
#{ASCIIDOC_BLANK_HDR}
|
270
292
|
mailto:fred@example.com
|
271
293
|
http://example.com[]
|
272
294
|
http://example.com[Link]
|
273
295
|
http://example.com[Link,title="tip"]
|
274
296
|
link:++https://asciidoctor.org/now_this__link_works.html++[]
|
297
|
+
http://example.com[Link,updatetype=true]
|
298
|
+
link:../example[updatetype=true]
|
299
|
+
link:../example[Link,updatetype=true]
|
275
300
|
INPUT
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
301
|
+
output = <<~OUTPUT
|
302
|
+
#{BLANK_HDR}
|
303
|
+
<sections>
|
304
|
+
<p id="_">mailto:fred@example.com
|
305
|
+
<link target="http://example.com"/>
|
306
|
+
<link target="http://example.com">Link</link>
|
307
|
+
<link target="http://example.com" alt="tip">Link</link>
|
308
|
+
<link target='https://asciidoctor.org/now_this__link_works.html'/>
|
309
|
+
<link target="http://example.com" updatetype="true">Link</link>
|
310
|
+
<link target="../example" updatetype="true"/>
|
311
|
+
<link target="../example" updatetype="true">Link</link></p>
|
312
|
+
</p>
|
313
|
+
</sections>
|
314
|
+
</standard-document>
|
286
315
|
OUTPUT
|
316
|
+
expect((strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
317
|
+
.to be_equivalent_to(output)
|
287
318
|
end
|
288
319
|
|
289
|
-
|
290
|
-
|
320
|
+
it "processes bookmarks" do
|
321
|
+
input = <<~INPUT
|
291
322
|
#{ASCIIDOC_BLANK_HDR}
|
292
323
|
Text [[bookmark]] Text
|
293
324
|
INPUT
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
325
|
+
output = <<~OUTPUT
|
326
|
+
#{BLANK_HDR}
|
327
|
+
<sections>
|
328
|
+
<p id="_">Text <bookmark id="bookmark"/> Text</p>
|
329
|
+
</sections>
|
330
|
+
</standard-document>
|
299
331
|
OUTPUT
|
300
|
-
|
332
|
+
expect((strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
333
|
+
.to be_equivalent_to(output)
|
334
|
+
end
|
301
335
|
|
302
|
-
|
303
|
-
|
336
|
+
it "processes crossreferences" do
|
337
|
+
input = <<~INPUT
|
304
338
|
#{ASCIIDOC_BLANK_HDR}
|
305
339
|
[[reference]]
|
306
340
|
== Section
|
@@ -318,39 +352,45 @@ OUTPUT
|
|
318
352
|
Lowercase Footnoted Reference to <<reference,droploc%fn>>
|
319
353
|
Capitalised Reference to <<reference,droploc%capital%>>
|
320
354
|
Lowercase Footnoted Reference to <<reference,droploc%capital%fn>>
|
355
|
+
Lowercase Footnoted Reference to <<reference,droploc%capital%text>>
|
321
356
|
INPUT
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
357
|
+
output = <<~OUTPUT
|
358
|
+
#{BLANK_HDR}
|
359
|
+
<sections>
|
360
|
+
<clause id="reference" inline-header="false" obligation="normative">
|
361
|
+
<title>Section</title>
|
362
|
+
<p id="_">Inline Reference to <xref target="reference"/>
|
363
|
+
Footnoted Reference to <xref target="reference"/>
|
364
|
+
Inline Reference with Text to <xref target="reference">text</xref>
|
365
|
+
Footnoted Reference with Text to <xref target="reference">text</xref>
|
366
|
+
Anchored Crossreference to other document <xref target="a#b"/>
|
367
|
+
Capitalised Reference to <xref target='reference' case='capital' droploc="true"></xref>
|
368
|
+
Lowercase Footnoted Reference to <xref target='reference' case='capital' droploc="true"></xref>
|
369
|
+
Capitalised Reference to
|
370
|
+
<xref target='reference' case='capital'/>
|
371
|
+
Lowercase Footnoted Reference to
|
372
|
+
<xref target='reference' case='capital'/>
|
373
|
+
Capitalised Reference to
|
374
|
+
<xref target='reference' droploc='true'/>
|
375
|
+
Lowercase Footnoted Reference to
|
376
|
+
<xref target='reference' droploc='true'/>
|
377
|
+
Capitalised Reference to
|
378
|
+
<xref target='reference' case='capital' droploc='true'/>
|
379
|
+
Lowercase Footnoted Reference to
|
380
|
+
<xref target='reference' case='capital' droploc='true'/>
|
381
|
+
Lowercase Footnoted Reference to
|
382
|
+
<xref target='reference' case='capital' droploc='true'>text</xref>
|
383
|
+
</p>
|
384
|
+
</clause>
|
385
|
+
</sections>
|
386
|
+
</standard-document>
|
387
|
+
OUTPUT
|
388
|
+
expect((strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
389
|
+
.to be_equivalent_to(output)
|
390
|
+
end
|
351
391
|
|
352
|
-
|
353
|
-
|
392
|
+
it "processes bibliographic anchors" do
|
393
|
+
input = <<~INPUT
|
354
394
|
#{ASCIIDOC_BLANK_HDR}
|
355
395
|
[bibliography]
|
356
396
|
== Normative References
|
@@ -359,29 +399,32 @@ OUTPUT
|
|
359
399
|
* [[[ISO713]]] Reference
|
360
400
|
|
361
401
|
INPUT
|
362
|
-
|
363
|
-
|
402
|
+
output = <<~OUTPUT
|
403
|
+
#{BLANK_HDR}
|
404
|
+
<sections>
|
364
405
|
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
406
|
+
</sections><bibliography><references id="_" obligation="informative" normative="true">
|
407
|
+
<title>Normative references</title>
|
408
|
+
<p id="_">The following documents are referred to in the text in such a way that some or all of their content constitutes requirements of this document. For dated references, only the edition cited applies. For undated references, the latest edition of the referenced document (including any amendments) applies.</p>
|
409
|
+
<bibitem id="ISO712">
|
410
|
+
<formattedref format="application/x-isodoc+xml">Reference</formattedref>
|
411
|
+
<docidentifier>x</docidentifier>
|
412
|
+
</bibitem>
|
413
|
+
<bibitem id="ISO713">
|
414
|
+
<formattedref format="application/x-isodoc+xml">Reference</formattedref>
|
415
|
+
<docidentifier>ISO713</docidentifier>
|
416
|
+
<docnumber>713</docnumber>
|
417
|
+
</bibitem>
|
418
|
+
</references>
|
419
|
+
</bibliography>
|
420
|
+
</standard-document>
|
380
421
|
OUTPUT
|
422
|
+
expect((strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
423
|
+
.to be_equivalent_to(output)
|
381
424
|
end
|
382
425
|
|
383
426
|
it "processes footnotes" do
|
384
|
-
|
427
|
+
input = <<~INPUT
|
385
428
|
#{ASCIIDOC_BLANK_HDR}
|
386
429
|
Hello!footnote:[Footnote text]
|
387
430
|
|
@@ -389,48 +432,52 @@ OUTPUT
|
|
389
432
|
|
390
433
|
Hello.footnote:abc[This is a repeated footnote]
|
391
434
|
|
392
|
-
Repetition.footnote:abc[]
|
435
|
+
Repetition.footnote:abc[]
|
393
436
|
INPUT
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
</
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
</
|
417
|
-
|
418
|
-
|
437
|
+
output = <<~OUTPUT
|
438
|
+
#{BLANK_HDR}
|
439
|
+
<preface><foreword id="_" obligation="informative">
|
440
|
+
<title>Foreword</title>
|
441
|
+
<p id="_">Hello!<fn reference="1">
|
442
|
+
<p id="_">Footnote text</p>
|
443
|
+
</fn></p>
|
444
|
+
</foreword></preface><sections>
|
445
|
+
<clause id="_" inline-header="false" obligation="normative">
|
446
|
+
<title>Title<fn reference="2">
|
447
|
+
<p id="_">Footnote text 2</p>
|
448
|
+
</fn></title>
|
449
|
+
<p id='_'>
|
450
|
+
Hello.
|
451
|
+
<fn reference='3'>
|
452
|
+
<p id='_'>This is a repeated footnote</p>
|
453
|
+
</fn>
|
454
|
+
</p>
|
455
|
+
<p id='_'>
|
456
|
+
Repetition.
|
457
|
+
<fn reference='3'>
|
458
|
+
<p id='_'>This is a repeated footnote</p>
|
459
|
+
</fn>
|
460
|
+
</p>
|
461
|
+
</clause></sections>
|
462
|
+
</standard-document>
|
419
463
|
OUTPUT
|
464
|
+
expect((strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
465
|
+
.to be_equivalent_to(output)
|
420
466
|
end
|
421
467
|
|
422
|
-
it "processes index terms" do
|
423
|
-
|
468
|
+
it "processes index terms" do
|
469
|
+
input = <<~INPUT
|
424
470
|
#{ASCIIDOC_BLANK_HDR}
|
425
471
|
((See)) Index ((_term_)) and(((A~B~, stem:[alpha], Ⲁ))).
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
</
|
432
|
-
|
472
|
+
INPUT
|
473
|
+
output = <<~OUTPUT
|
474
|
+
#{BLANK_HDR}
|
475
|
+
<sections>
|
476
|
+
<p id="_">See<index><primary>See</primary></index> Index <em>term</em><index><primary><em>term</em></primary></index> and<index><primary>A<sub>B</sub></primary><secondary><stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>α</mi></math></stem></secondary><tertiary>Ⲁ</tertiary></index>.</p>
|
477
|
+
</sections>
|
478
|
+
</standard-document>
|
479
|
+
OUTPUT
|
480
|
+
expect((strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
481
|
+
.to be_equivalent_to(output)
|
433
482
|
end
|
434
|
-
|
435
|
-
|
436
483
|
end
|