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
@@ -2,7 +2,7 @@ require "spec_helper"
|
|
2
2
|
|
3
3
|
RSpec.describe Asciidoctor::Standoc do
|
4
4
|
it "processes simple lists" do
|
5
|
-
output = Asciidoctor.convert(<<~"INPUT",
|
5
|
+
output = Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
6
6
|
#{ASCIIDOC_BLANK_HDR}
|
7
7
|
* List 1
|
8
8
|
* List 2
|
@@ -70,7 +70,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
70
70
|
end
|
71
71
|
|
72
72
|
it "processes complex lists" do
|
73
|
-
output = Asciidoctor.convert(<<~"INPUT",
|
73
|
+
output = Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
74
74
|
#{ASCIIDOC_BLANK_HDR}
|
75
75
|
[[id]]
|
76
76
|
[keep-with-next=true,keep-lines-together=true]
|
@@ -189,7 +189,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
189
189
|
end
|
190
190
|
|
191
191
|
it "anchors lists and list items" do
|
192
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
192
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
193
193
|
#{ASCIIDOC_BLANK_HDR}
|
194
194
|
[[id1]]
|
195
195
|
* [[id2]] List item
|
@@ -2,7 +2,7 @@ require "spec_helper"
|
|
2
2
|
|
3
3
|
RSpec.describe Asciidoctor::Standoc do
|
4
4
|
it "processes the PlantUML macro" do
|
5
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
5
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)).gsub(%r{plantuml/plantuml[^./]+\.}, "plantuml/_."))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
6
6
|
#{ASCIIDOC_BLANK_HDR}
|
7
7
|
|
8
8
|
[plantuml]
|
@@ -53,7 +53,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
53
53
|
end
|
54
54
|
|
55
55
|
it "processes the PlantUML macro with imagesdir" do
|
56
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
56
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)).gsub(%r{spec/assets/[^./]+\.}, "spec/assets/_."))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
57
57
|
= Document title
|
58
58
|
Author
|
59
59
|
:docfile: test.adoc
|
@@ -119,7 +119,7 @@ OUTPUT
|
|
119
119
|
it "processes the lutaml_diagram" do
|
120
120
|
expect(
|
121
121
|
xmlpp(
|
122
|
-
strip_guid(Asciidoctor.convert(input,
|
122
|
+
strip_guid(Asciidoctor.convert(input, *OPTIONS))
|
123
123
|
.gsub(%r{".+spec\/assets\/lutaml\/[^.\/]+\.}, %q("spec/assets/_.))))
|
124
124
|
.to(be_equivalent_to xmlpp(output))
|
125
125
|
end
|
@@ -187,14 +187,14 @@ OUTPUT
|
|
187
187
|
it "processes the lutaml_uml_attributes_table macro" do
|
188
188
|
expect(
|
189
189
|
xmlpp(
|
190
|
-
strip_guid(Asciidoctor.convert(input,
|
190
|
+
strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
191
191
|
.to(be_equivalent_to(xmlpp(output)))
|
192
192
|
end
|
193
193
|
end
|
194
194
|
|
195
195
|
it "processes the PlantUML macro with PlantUML disabled" do
|
196
196
|
mock_plantuml_disabled
|
197
|
-
expect { Asciidoctor.convert(<<~"INPUT",
|
197
|
+
expect { Asciidoctor.convert(<<~"INPUT", *OPTIONS) }.to output(%r{PlantUML not installed}).to_stderr
|
198
198
|
#{ASCIIDOC_BLANK_HDR}
|
199
199
|
|
200
200
|
[plantuml]
|
@@ -210,7 +210,7 @@ OUTPUT
|
|
210
210
|
INPUT
|
211
211
|
|
212
212
|
mock_plantuml_disabled
|
213
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
213
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
214
214
|
#{ASCIIDOC_BLANK_HDR}
|
215
215
|
|
216
216
|
[plantuml]
|
@@ -240,7 +240,7 @@ Alice <-- Bob: another authentication Response
|
|
240
240
|
|
241
241
|
it "processes the PlantUML macro with localdir unwritable" do
|
242
242
|
mock_localdir_unwritable
|
243
|
-
expect { Asciidoctor.convert(<<~"INPUT",
|
243
|
+
expect { Asciidoctor.convert(<<~"INPUT", *OPTIONS) }.to output(%r{not writable for PlantUML}).to_stderr
|
244
244
|
#{ASCIIDOC_BLANK_HDR}
|
245
245
|
|
246
246
|
[plantuml]
|
@@ -256,7 +256,7 @@ Alice <-- Bob: another authentication Response
|
|
256
256
|
INPUT
|
257
257
|
|
258
258
|
mock_localdir_unwritable
|
259
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
259
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
260
260
|
#{ASCIIDOC_BLANK_HDR}
|
261
261
|
|
262
262
|
[plantuml]
|
@@ -2,50 +2,56 @@ require "spec_helper"
|
|
2
2
|
|
3
3
|
RSpec.describe Asciidoctor::Standoc do
|
4
4
|
it "processes the Asciidoctor::Standoc inline macros" 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
|
alt:[term1]
|
8
8
|
deprecated:[term1]
|
9
9
|
domain:[term1]
|
10
10
|
inherit:[<<ref1>>]
|
11
11
|
autonumber:table[3]
|
12
|
+
add:[a <<clause>>] del:[B]
|
12
13
|
|
13
14
|
[bibliography]
|
14
15
|
== Bibliography
|
15
16
|
* [[[ref1,XYZ 123]]] _Title_
|
16
17
|
INPUT
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
<
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
<
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
</
|
43
|
-
|
18
|
+
#{BLANK_HDR}
|
19
|
+
<preface>
|
20
|
+
<foreword id='_' obligation='informative'>
|
21
|
+
<title>Foreword</title>
|
22
|
+
<admitted>term1</admitted>
|
23
|
+
<deprecates>term1</deprecates>
|
24
|
+
<domain>term1</domain>
|
25
|
+
<inherit>
|
26
|
+
<eref type='inline' bibitemid='ref1' citeas='XYZ 123'/>
|
27
|
+
</inherit>
|
28
|
+
<autonumber type='table'>3</autonumber>
|
29
|
+
<add>
|
30
|
+
a
|
31
|
+
<xref target='clause'/>
|
32
|
+
</add>
|
33
|
+
<del>B</del>
|
34
|
+
</foreword>
|
35
|
+
</preface>
|
36
|
+
<sections> </sections>
|
37
|
+
<bibliography>
|
38
|
+
<references id='_' obligation='informative' normative="false">
|
39
|
+
<title>Bibliography</title>
|
40
|
+
<bibitem id='ref1'>
|
41
|
+
<formattedref format='application/x-isodoc+xml'>
|
42
|
+
<em>Title</em>
|
43
|
+
</formattedref>
|
44
|
+
<docidentifier>XYZ 123</docidentifier>
|
45
|
+
<docnumber>123</docnumber>
|
46
|
+
</bibitem>
|
47
|
+
</references>
|
48
|
+
</bibliography>
|
49
|
+
</standard-document>
|
44
50
|
OUTPUT
|
45
51
|
end
|
46
52
|
|
47
53
|
it "processes the Asciidoctor::Standoc index macros" do
|
48
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
54
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
49
55
|
#{ASCIIDOC_BLANK_HDR}
|
50
56
|
index:also[]
|
51
57
|
index:see[A]
|
@@ -61,94 +67,93 @@ RSpec.describe Asciidoctor::Standoc do
|
|
61
67
|
|
62
68
|
Text [[id3]]
|
63
69
|
INPUT
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
<index to="id2">
|
89
|
-
|
90
|
-
</index>
|
91
|
-
<em>P</em>
|
92
|
-
<index to="id3">
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
</index>
|
97
|
-
<index to="id3">
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
</index>
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
</standard-document>
|
70
|
+
#{BLANK_HDR}
|
71
|
+
<sections>
|
72
|
+
<p id='_'>
|
73
|
+
<index-xref also='true'>
|
74
|
+
<primary>B</primary>
|
75
|
+
<target>
|
76
|
+
C
|
77
|
+
<sub>x</sub>
|
78
|
+
</target>
|
79
|
+
</index-xref>
|
80
|
+
<index-xref also='false'>
|
81
|
+
<primary>D</primary>
|
82
|
+
<secondary>
|
83
|
+
<em>E</em>
|
84
|
+
</secondary>
|
85
|
+
<target>F</target>
|
86
|
+
</index-xref>
|
87
|
+
<index-xref also='true'>
|
88
|
+
<primary>G</primary>
|
89
|
+
<secondary>H</secondary>
|
90
|
+
<tertiary>I</tertiary>
|
91
|
+
<target>J</target>
|
92
|
+
</index-xref>
|
93
|
+
P
|
94
|
+
<index to="id2">
|
95
|
+
<primary>P</primary>
|
96
|
+
</index>
|
97
|
+
<em>P</em>
|
98
|
+
<index to="id3">
|
99
|
+
<primary>
|
100
|
+
<em>P</em>
|
101
|
+
</primary>
|
102
|
+
</index>
|
103
|
+
<index to="id3">
|
104
|
+
<primary>Q</primary>
|
105
|
+
<secondary>R</secondary>
|
106
|
+
<tertiary>S</tertiary>
|
107
|
+
</index>
|
108
|
+
</p>
|
109
|
+
<p id='_'>
|
110
|
+
Text
|
111
|
+
<bookmark id='id2'/>
|
112
|
+
</p>
|
113
|
+
<p id='_'>
|
114
|
+
Text
|
115
|
+
<bookmark id='id3'/>
|
116
|
+
</p>
|
117
|
+
</sections>
|
118
|
+
</standard-document>
|
113
119
|
OUTPUT
|
114
120
|
end
|
115
121
|
|
116
122
|
it "processes the Asciidoctor::Standoc variant macros" do
|
117
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
123
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
118
124
|
#{ASCIIDOC_BLANK_HDR}
|
119
125
|
== lang:en[English] lang:fr-Latn[Français]
|
120
126
|
|
121
127
|
this lang:en[English] lang:fr-Latn[Français] section is lang:en[silly] lang:fr[fou]
|
122
128
|
|
123
129
|
INPUT
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
</sections>
|
145
|
-
|
130
|
+
#{BLANK_HDR}
|
131
|
+
<sections>
|
132
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
133
|
+
<title>
|
134
|
+
<variant lang='en'>English</variant>
|
135
|
+
<variant lang='fr' script='Latn'>Français</variant>
|
136
|
+
</title>
|
137
|
+
<p id='_'>
|
138
|
+
this
|
139
|
+
<variant>
|
140
|
+
<variant lang='en'>English</variant>
|
141
|
+
<variant lang='fr' script='Latn'>Français</variant>
|
142
|
+
</variant>
|
143
|
+
section is
|
144
|
+
<variant>
|
145
|
+
<variant lang='en'>silly</variant>
|
146
|
+
<variant lang='fr'>fou</variant>
|
147
|
+
</variant>
|
148
|
+
</p>
|
149
|
+
</clause>
|
150
|
+
</sections>
|
151
|
+
</standard-document>
|
146
152
|
OUTPUT
|
147
153
|
end
|
148
154
|
|
149
|
-
|
150
|
-
|
151
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
155
|
+
it "processes the Asciidoctor::Standoc concept macros" do
|
156
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
152
157
|
#{ASCIIDOC_BLANK_HDR}
|
153
158
|
{{clause1}}
|
154
159
|
{{clause1,w\[o\]rd}}
|
@@ -173,132 +178,132 @@ RSpec.describe Asciidoctor::Standoc do
|
|
173
178
|
[bibliography]
|
174
179
|
== Bibliography
|
175
180
|
* [[[blah,blah]]] _Blah_
|
176
|
-
INPUT
|
177
|
-
#{BLANK_HDR}
|
178
|
-
<preface>
|
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
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
</preface>
|
279
|
-
<sections>
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
</sections>
|
285
|
-
<bibliography>
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
</bibliography>
|
296
|
-
</standard-document>
|
297
|
-
OUTPUT
|
298
|
-
|
181
|
+
INPUT
|
182
|
+
#{BLANK_HDR}
|
183
|
+
<preface>
|
184
|
+
<foreword id='_' obligation='informative'>
|
185
|
+
<title>Foreword</title>
|
186
|
+
<p id='_'>
|
187
|
+
<concept>
|
188
|
+
<xref target='clause1'/>
|
189
|
+
</concept>
|
190
|
+
<concept>
|
191
|
+
<xref target='clause1'>w[o]rd</xref>
|
192
|
+
</concept>
|
193
|
+
<concept term='term'>
|
194
|
+
<xref target='clause1'>w[o]rd</xref>
|
195
|
+
</concept>
|
196
|
+
<concept>
|
197
|
+
<eref/>
|
198
|
+
</concept>
|
199
|
+
<concept>
|
200
|
+
<eref>word</eref>
|
201
|
+
</concept>
|
202
|
+
<concept term='term'>
|
203
|
+
<eref>word</eref>
|
204
|
+
</concept>
|
205
|
+
<concept>
|
206
|
+
<eref>
|
207
|
+
<localityStack>
|
208
|
+
<locality type='clause'>
|
209
|
+
<referenceFrom>3.1</referenceFrom>
|
210
|
+
</locality>
|
211
|
+
</localityStack>
|
212
|
+
</eref>
|
213
|
+
</concept>
|
214
|
+
<concept>
|
215
|
+
<eref>
|
216
|
+
<localityStack>
|
217
|
+
<locality type='clause'>
|
218
|
+
<referenceFrom>3.1</referenceFrom>
|
219
|
+
</locality>
|
220
|
+
</localityStack>
|
221
|
+
word
|
222
|
+
</eref>
|
223
|
+
</concept>
|
224
|
+
<concept term='term'>
|
225
|
+
<eref>
|
226
|
+
<localityStack>
|
227
|
+
<locality type='clause'>
|
228
|
+
<referenceFrom>3.1</referenceFrom>
|
229
|
+
</locality>
|
230
|
+
</localityStack>
|
231
|
+
word
|
232
|
+
</eref>
|
233
|
+
</concept>
|
234
|
+
<concept>
|
235
|
+
<eref>
|
236
|
+
<localityStack>
|
237
|
+
<locality type='clause'>
|
238
|
+
<referenceFrom>3.1</referenceFrom>
|
239
|
+
</locality>
|
240
|
+
<locality type='figure'>
|
241
|
+
<referenceFrom>a</referenceFrom>
|
242
|
+
</locality>
|
243
|
+
</localityStack>
|
244
|
+
</eref>
|
245
|
+
</concept>
|
246
|
+
<concept>
|
247
|
+
<eref>
|
248
|
+
<localityStack>
|
249
|
+
<locality type='clause'>
|
250
|
+
<referenceFrom>3.1</referenceFrom>
|
251
|
+
</locality>
|
252
|
+
<locality type='figure'>
|
253
|
+
<referenceFrom>a</referenceFrom>
|
254
|
+
</locality>
|
255
|
+
</localityStack>
|
256
|
+
word
|
257
|
+
</eref>
|
258
|
+
</concept>
|
259
|
+
<concept term='term'>
|
260
|
+
<eref>
|
261
|
+
<localityStack>
|
262
|
+
<locality type='clause'>
|
263
|
+
<referenceFrom>3.1</referenceFrom>
|
264
|
+
</locality>
|
265
|
+
<locality type='figure'>
|
266
|
+
<referenceFrom>a</referenceFrom>
|
267
|
+
</locality>
|
268
|
+
</localityStack>
|
269
|
+
word
|
270
|
+
</eref>
|
271
|
+
</concept>
|
272
|
+
<concept>
|
273
|
+
<termref base='IEV' target='135-13-13'/>
|
274
|
+
</concept>
|
275
|
+
<concept>
|
276
|
+
<termref base='IEV' target='135-13-13'>word</termref>
|
277
|
+
</concept>
|
278
|
+
<concept term='term'>
|
279
|
+
<termref base='IEV' target='135-13-13'>word</termref>
|
280
|
+
</concept>
|
281
|
+
</p>
|
282
|
+
</foreword>
|
283
|
+
</preface>
|
284
|
+
<sections>
|
285
|
+
<clause id='clause1' inline-header='false' obligation='normative'>
|
286
|
+
<title>Clause</title>
|
287
|
+
<p id='_'>Terms are defined here</p>
|
288
|
+
</clause>
|
289
|
+
</sections>
|
290
|
+
<bibliography>
|
291
|
+
<references id='_' obligation='informative' normative="false">
|
292
|
+
<title>Bibliography</title>
|
293
|
+
<bibitem id='blah'>
|
294
|
+
<formattedref format='application/x-isodoc+xml'>
|
295
|
+
<em>Blah</em>
|
296
|
+
</formattedref>
|
297
|
+
<docidentifier>blah</docidentifier>
|
298
|
+
</bibitem>
|
299
|
+
</references>
|
300
|
+
</bibliography>
|
301
|
+
</standard-document>
|
302
|
+
OUTPUT
|
303
|
+
end
|
299
304
|
|
300
305
|
it "processes the TODO custom admonition" do
|
301
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
306
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
302
307
|
#{ASCIIDOC_BLANK_HDR}
|
303
308
|
TODO: Note1
|
304
309
|
|
@@ -310,160 +315,160 @@ OUTPUT
|
|
310
315
|
[TODO]
|
311
316
|
Note3
|
312
317
|
INPUT
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
318
|
+
#{BLANK_HDR}
|
319
|
+
<sections><review reviewer="(Unknown)" id="_" date="#{Date.today}T00:00:00Z">
|
320
|
+
<p id="_"/>
|
321
|
+
</review>
|
322
|
+
<review reviewer="(Unknown)" id="_" date="#{Date.today}T00:00:00Z">
|
323
|
+
<p id="_">Note2</p>
|
324
|
+
</review>
|
325
|
+
<review reviewer="(Unknown)" id="_" date="#{Date.today}T00:00:00Z">
|
326
|
+
<p id="_">Note3</p>
|
327
|
+
</review></sections>
|
328
|
+
</standard-document>
|
324
329
|
OUTPUT
|
325
330
|
end
|
326
331
|
|
327
332
|
it "generates pseudocode examples, with formatting and initial indentation" do
|
328
|
-
|
329
|
-
|
333
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
334
|
+
#{ASCIIDOC_BLANK_HDR}
|
330
335
|
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
+
[pseudocode,subsequence="A",number="3",keep-with-next=true,keep-lines-together=true]
|
337
|
+
[%unnumbered]
|
338
|
+
====
|
339
|
+
*A* +
|
340
|
+
[smallcap]#B#
|
336
341
|
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
<p id="_"> <em>C</em></p></figure>
|
346
|
-
</sections>
|
347
|
-
</standard-document>
|
348
|
-
|
349
|
-
|
342
|
+
_C_
|
343
|
+
====
|
344
|
+
INPUT
|
345
|
+
#{BLANK_HDR}
|
346
|
+
<sections>
|
347
|
+
<figure id="_" subsequence='A' class="pseudocode" unnumbered="true" number="3" keep-with-next="true" keep-lines-together="true">
|
348
|
+
<p id="_"> <strong>A</strong><br/>
|
349
|
+
<smallcap>B</smallcap></p>
|
350
|
+
<p id="_"> <em>C</em></p></figure>
|
351
|
+
</sections>
|
352
|
+
</standard-document>
|
353
|
+
OUTPUT
|
354
|
+
end
|
350
355
|
|
351
|
-
|
352
|
-
|
353
|
-
|
356
|
+
it "supplies line breaks in pseudocode" do
|
357
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
358
|
+
#{ASCIIDOC_BLANK_HDR}
|
354
359
|
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
360
|
+
[pseudocode]
|
361
|
+
====
|
362
|
+
A
|
363
|
+
B
|
359
364
|
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
<figure id='_' class='pseudocode'>
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
</sections>
|
379
|
-
</standard-document>
|
380
|
-
|
381
|
-
|
365
|
+
D
|
366
|
+
E
|
367
|
+
====
|
368
|
+
INPUT
|
369
|
+
#{BLANK_HDR}
|
370
|
+
<sections>
|
371
|
+
<figure id='_' class='pseudocode'>
|
372
|
+
<p id='_'>
|
373
|
+
A
|
374
|
+
<br/>
|
375
|
+
B
|
376
|
+
</p>
|
377
|
+
<p id='_'>
|
378
|
+
D
|
379
|
+
<br/>
|
380
|
+
E
|
381
|
+
</p>
|
382
|
+
</figure>
|
383
|
+
</sections>
|
384
|
+
</standard-document>
|
385
|
+
OUTPUT
|
386
|
+
end
|
382
387
|
|
383
|
-
|
384
|
-
|
385
|
-
|
388
|
+
it "skips embedded blocks when supplying line breaks in pseudocode" do
|
389
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
390
|
+
#{ASCIIDOC_BLANK_HDR}
|
386
391
|
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
<figure id='_' class='pseudocode'>
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
<mo>=</mo>
|
409
|
-
<mfrac>
|
410
|
-
<mrow>
|
411
|
-
<mn>1</mn>
|
412
|
-
</mrow>
|
413
|
-
<mrow>
|
414
|
-
<mi>v</mi>
|
415
|
-
</mrow>
|
416
|
-
</mfrac>
|
417
|
-
<munderover>
|
418
|
-
<mrow>
|
419
|
-
<mo>∑</mo>
|
420
|
-
</mrow>
|
421
|
-
<mrow>
|
422
|
-
<mrow>
|
423
|
-
<mi>i</mi>
|
392
|
+
[pseudocode]
|
393
|
+
====
|
394
|
+
[stem]
|
395
|
+
++++
|
396
|
+
bar X' = (1)/(v) sum_(i = 1)^(v) t_(i)
|
397
|
+
++++
|
398
|
+
====
|
399
|
+
INPUT
|
400
|
+
#{BLANK_HDR}
|
401
|
+
<sections>
|
402
|
+
<figure id='_' class='pseudocode'>
|
403
|
+
<formula id='_'>
|
404
|
+
<stem type='MathML'>
|
405
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
406
|
+
<mover accent="true">
|
407
|
+
<mrow>
|
408
|
+
<mi>X</mi>
|
409
|
+
</mrow>
|
410
|
+
<mo>¯</mo>
|
411
|
+
</mover>
|
412
|
+
<mo>′</mo>
|
424
413
|
<mo>=</mo>
|
425
|
-
<
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
</
|
446
|
-
|
447
|
-
|
414
|
+
<mfrac>
|
415
|
+
<mrow>
|
416
|
+
<mn>1</mn>
|
417
|
+
</mrow>
|
418
|
+
<mrow>
|
419
|
+
<mi>v</mi>
|
420
|
+
</mrow>
|
421
|
+
</mfrac>
|
422
|
+
<munderover>
|
423
|
+
<mrow>
|
424
|
+
<mo>∑</mo>
|
425
|
+
</mrow>
|
426
|
+
<mrow>
|
427
|
+
<mrow>
|
428
|
+
<mi>i</mi>
|
429
|
+
<mo>=</mo>
|
430
|
+
<mn>1</mn>
|
431
|
+
</mrow>
|
432
|
+
</mrow>
|
433
|
+
<mrow>
|
434
|
+
<mi>v</mi>
|
435
|
+
</mrow>
|
436
|
+
</munderover>
|
437
|
+
<msub>
|
438
|
+
<mrow>
|
439
|
+
<mi>t</mi>
|
440
|
+
</mrow>
|
441
|
+
<mrow>
|
442
|
+
<mi>i</mi>
|
443
|
+
</mrow>
|
444
|
+
</msub>
|
445
|
+
</math>
|
446
|
+
</stem>
|
447
|
+
</formula>
|
448
|
+
</figure>
|
449
|
+
</sections>
|
450
|
+
</standard-document>
|
451
|
+
OUTPUT
|
452
|
+
end
|
448
453
|
|
449
454
|
it "processes the Ruby markups" do
|
450
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
455
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
451
456
|
#{ASCIIDOC_BLANK_HDR}
|
452
457
|
|
453
458
|
ruby:楽聖少女[がくせいしょうじょ]
|
454
459
|
INPUT
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
460
|
+
#{BLANK_HDR}
|
461
|
+
<sections>
|
462
|
+
<p id="_">
|
463
|
+
<ruby>楽聖少女<rp>(</rp><rt>がくせいしょうじょ</rt><rp>)</rp></ruby>
|
464
|
+
</p>
|
465
|
+
</sections>
|
466
|
+
</standard-document>
|
462
467
|
OUTPUT
|
463
468
|
end
|
464
469
|
|
465
470
|
it "processes the footnoteblock macro" do
|
466
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
471
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
467
472
|
#{ASCIIDOC_BLANK_HDR}
|
468
473
|
|
469
474
|
footnoteblock:[id1]
|
@@ -482,44 +487,44 @@ OUTPUT
|
|
482
487
|
* C
|
483
488
|
--
|
484
489
|
INPUT
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
</fn>
|
515
|
-
|
516
|
-
|
517
|
-
|
490
|
+
#{BLANK_HDR}
|
491
|
+
<sections>
|
492
|
+
<p id="_">
|
493
|
+
<fn reference='1'>
|
494
|
+
<table id='_'>
|
495
|
+
<thead>
|
496
|
+
<tr>
|
497
|
+
<th valign='top' align='left'>a</th>
|
498
|
+
<th valign='top' align='left'>b</th>
|
499
|
+
</tr>
|
500
|
+
</thead>
|
501
|
+
<tbody>
|
502
|
+
<tr>
|
503
|
+
<td valign='top' align='left'>c</td>
|
504
|
+
<td valign='top' align='left'>d</td>
|
505
|
+
</tr>
|
506
|
+
</tbody>
|
507
|
+
</table>
|
508
|
+
<ul id='_'>
|
509
|
+
<li>
|
510
|
+
<p id='_'>A</p>
|
511
|
+
</li>
|
512
|
+
<li>
|
513
|
+
<p id='_'>B</p>
|
514
|
+
</li>
|
515
|
+
<li>
|
516
|
+
<p id='_'>C</p>
|
517
|
+
</li>
|
518
|
+
</ul>
|
519
|
+
</fn>
|
520
|
+
</p>
|
521
|
+
</sections>
|
522
|
+
</standard-document>
|
518
523
|
OUTPUT
|
519
524
|
end
|
520
525
|
|
521
|
-
|
522
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
526
|
+
it "processes the footnoteblock macro with failed reference" do
|
527
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
523
528
|
#{ASCIIDOC_BLANK_HDR}
|
524
529
|
|
525
530
|
footnoteblock:[id1]
|
@@ -538,49 +543,149 @@ OUTPUT
|
|
538
543
|
* C
|
539
544
|
--
|
540
545
|
INPUT
|
541
|
-
|
546
|
+
#{BLANK_HDR}
|
547
|
+
<sections>
|
548
|
+
<p id='_'>
|
549
|
+
<fn reference='1'>[ERROR]</fn>
|
550
|
+
</p>
|
551
|
+
<note id='id2'>
|
552
|
+
<table id='_'>
|
553
|
+
<thead>
|
554
|
+
<tr>
|
555
|
+
<th valign='top' align='left'>a</th>
|
556
|
+
<th valign='top' align='left'>b</th>
|
557
|
+
</tr>
|
558
|
+
</thead>
|
559
|
+
<tbody>
|
560
|
+
<tr>
|
561
|
+
<td valign='top' align='left'>c</td>
|
562
|
+
<td valign='top' align='left'>d</td>
|
563
|
+
</tr>
|
564
|
+
</tbody>
|
565
|
+
</table>
|
566
|
+
<ul id='_'>
|
567
|
+
<li>
|
568
|
+
<p id='_'>A</p>
|
569
|
+
</li>
|
570
|
+
<li>
|
571
|
+
<p id='_'>B</p>
|
572
|
+
</li>
|
573
|
+
<li>
|
574
|
+
<p id='_'>C</p>
|
575
|
+
</li>
|
576
|
+
</ul>
|
577
|
+
</note>
|
578
|
+
</sections>
|
579
|
+
</standard-document>
|
580
|
+
OUTPUT
|
581
|
+
end
|
582
|
+
|
583
|
+
it "processes input form macros" do
|
584
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
585
|
+
#{ASCIIDOC_BLANK_HDR}
|
586
|
+
|
587
|
+
[form,id=N0,name=N1,action="/action_page.php"]
|
588
|
+
--
|
589
|
+
label:fname[First name:] +
|
590
|
+
input:text[id=fname,name=fname] +
|
591
|
+
label:lname[Last name:] +
|
592
|
+
input:text[id=lname,name=lname] +
|
593
|
+
label:pwd[Password:] +
|
594
|
+
input:password[id=pwd,name=pwd] +
|
595
|
+
input:radio[id=male,name=gender,value=male]
|
596
|
+
label:male[Male] +
|
597
|
+
input:radio[id=female,name=gender,value=female]
|
598
|
+
label:female[Female] +
|
599
|
+
input:radio[id=other,name=gender,value=other]
|
600
|
+
label:other[Other] +
|
601
|
+
input:checkbox[id=vehicle1,name=vehicle1,value=Bike,checked=true]
|
602
|
+
label:vehicle1[I have a bike] +
|
603
|
+
input:checkbox[id=vehicle2,name=vehicle2,value=Car]
|
604
|
+
label:vehicle2[I have a car] +
|
605
|
+
input:checkbox[id=vehicle3,name=vehicle3,value=Boat]
|
606
|
+
label:vehicle3[I have a boat] +
|
607
|
+
input:date[id=birthday,name=birthday] +
|
608
|
+
label:myfile[Select a file:]
|
609
|
+
input:file[id=myfile,name=myfile] +
|
610
|
+
label:cars[Select a car:] +
|
611
|
+
select:[id=cars,name=cars,value=fiat,size=4,disabled=true,multiple=true]
|
612
|
+
option:[Volvo,value=volvo,disabled=true]
|
613
|
+
option:[Saab,value=saab]
|
614
|
+
option:[Fiat,value=fiat]
|
615
|
+
option:[Audi,value=audi]
|
616
|
+
textarea:[id=t1,name=message,rows=10,cols=30,value="The cat was playing in the garden."]
|
617
|
+
input:button[value="Click Me!"]
|
618
|
+
input:button[]
|
619
|
+
input:submit[value="Submit"]
|
620
|
+
--
|
621
|
+
INPUT
|
622
|
+
#{BLANK_HDR}
|
542
623
|
<sections>
|
543
|
-
|
544
|
-
|
545
|
-
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
|
567
|
-
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
|
572
|
-
|
573
|
-
|
574
|
-
|
624
|
+
<form id='_' name='N1' action='/action_page.php'>
|
625
|
+
<p id='_'>
|
626
|
+
<label for='fname'>First name:</label>
|
627
|
+
<br/>
|
628
|
+
<input type='text' id='fname' name='fname'/>
|
629
|
+
<br/>
|
630
|
+
<label for='lname'>Last name:</label>
|
631
|
+
<br/>
|
632
|
+
<input type='text' id='lname' name='lname'/>
|
633
|
+
<br/>
|
634
|
+
<label for='pwd'>Password:</label>
|
635
|
+
<br/>
|
636
|
+
<input type='password' id='pwd' name='pwd'/>
|
637
|
+
<br/>
|
638
|
+
<input type='radio' id='male' name='gender' value='male'/>
|
639
|
+
<label for='male'>Male</label>
|
640
|
+
<br/>
|
641
|
+
<input type='radio' id='female' name='gender' value='female'/>
|
642
|
+
<label for='female'>Female</label>
|
643
|
+
<br/>
|
644
|
+
<input type='radio' id='other' name='gender' value='other'/>
|
645
|
+
<label for='other'>Other</label>
|
646
|
+
<br/>
|
647
|
+
<input type='checkbox' id='vehicle1' name='vehicle1' value='Bike' checked='true'/>
|
648
|
+
<label for='vehicle1'>I have a bike</label>
|
649
|
+
<br/>
|
650
|
+
<input type='checkbox' id='vehicle2' name='vehicle2' value='Car'/>
|
651
|
+
<label for='vehicle2'>I have a car</label>
|
652
|
+
<br/>
|
653
|
+
<input type='checkbox' id='vehicle3' name='vehicle3' value='Boat'/>
|
654
|
+
<label for='vehicle3'>I have a boat</label>
|
655
|
+
<br/>
|
656
|
+
<input type='date' id='birthday' name='birthday'/>
|
657
|
+
<br/>
|
658
|
+
<label for='myfile'>Select a file:</label>
|
659
|
+
<input type='file' id='myfile' name='myfile'/>
|
660
|
+
<br/>
|
661
|
+
<label for='cars'>Select a car:</label>
|
662
|
+
<br/>
|
663
|
+
<select id='cars' name='cars' size='4' disabled='true' multiple='true' value='fiat'>
|
664
|
+
<option disabled='true' value='volvo'/>
|
665
|
+
<option value='saab'/>
|
666
|
+
<option value='fiat'/>
|
667
|
+
<option value='audi'/>
|
668
|
+
</select>
|
669
|
+
<textarea id='t1' name='message' rows='10' cols='30' value='The cat was playing in the garden.'/>
|
670
|
+
<input type='button' value='Click Me!'/>
|
671
|
+
<input type='button'/>
|
672
|
+
<input type='submit' value='Submit'/>
|
673
|
+
</p>
|
674
|
+
</form>
|
675
|
+
</sections>
|
676
|
+
</standard-document>
|
575
677
|
OUTPUT
|
576
678
|
end
|
577
679
|
|
578
|
-
|
680
|
+
describe "term inline macros" do
|
579
681
|
subject(:convert) do
|
580
682
|
xmlpp(
|
581
683
|
strip_guid(
|
582
684
|
Asciidoctor.convert(
|
583
|
-
input,
|
685
|
+
input, *OPTIONS
|
686
|
+
)
|
687
|
+
)
|
688
|
+
)
|
584
689
|
end
|
585
690
|
let(:input) do
|
586
691
|
<<~XML
|
@@ -619,11 +724,11 @@ OUTPUT
|
|
619
724
|
XML
|
620
725
|
end
|
621
726
|
|
622
|
-
it
|
727
|
+
it "converts macro into the correct xml" do
|
623
728
|
expect(convert).to(be_equivalent_to(xmlpp(output)))
|
624
729
|
end
|
625
730
|
|
626
|
-
context
|
731
|
+
context "default params" do
|
627
732
|
let(:input) do
|
628
733
|
<<~XML
|
629
734
|
#{ASCIIDOC_BLANK_HDR}
|
@@ -662,12 +767,12 @@ OUTPUT
|
|
662
767
|
XML
|
663
768
|
end
|
664
769
|
|
665
|
-
it
|
770
|
+
it "uses `name` as termref name" do
|
666
771
|
expect(convert).to(be_equivalent_to(xmlpp(output)))
|
667
772
|
end
|
668
773
|
end
|
669
774
|
|
670
|
-
|
775
|
+
context "multiply exising ids in document" do
|
671
776
|
let(:input) do
|
672
777
|
<<~XML
|
673
778
|
#{ASCIIDOC_BLANK_HDR}
|
@@ -725,12 +830,12 @@ OUTPUT
|
|
725
830
|
XML
|
726
831
|
end
|
727
832
|
|
728
|
-
it
|
833
|
+
it "generates unique ids which do not match existing ids" do
|
729
834
|
expect(convert).to(be_equivalent_to(xmlpp(output)))
|
730
835
|
end
|
731
836
|
end
|
732
837
|
|
733
|
-
|
838
|
+
context "when missing actual ref" do
|
734
839
|
let(:input) do
|
735
840
|
<<~XML
|
736
841
|
#{ASCIIDOC_BLANK_HDR}
|
@@ -759,8 +864,8 @@ OUTPUT
|
|
759
864
|
<title>Terms and definitions</title>
|
760
865
|
<p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
|
761
866
|
<term id='term-name-identity'>
|
762
|
-
|
763
|
-
</term>
|
867
|
+
<preferred>name identity</preferred>
|
868
|
+
</term>
|
764
869
|
<term id='name-check'>
|
765
870
|
<preferred>name check</preferred>
|
766
871
|
<definition>
|
@@ -777,8 +882,7 @@ OUTPUT
|
|
777
882
|
<xref target='term-name-identity'/>
|
778
883
|
) is a term
|
779
884
|
</p>
|
780
|
-
<p id="_">Moreover, (<strong>term “missing” not resolved</strong>) is a term
|
781
|
-
</p>
|
885
|
+
<p id="_">Moreover, (<strong>term “missing” not resolved</strong>) is a term</p>
|
782
886
|
</definition>
|
783
887
|
</term>
|
784
888
|
</terms>
|
@@ -787,11 +891,9 @@ OUTPUT
|
|
787
891
|
XML
|
788
892
|
end
|
789
893
|
|
790
|
-
it
|
894
|
+
it "generates unique ids which do not match existing ids" do
|
791
895
|
expect(convert).to(be_equivalent_to(xmlpp(output)))
|
792
896
|
end
|
793
897
|
end
|
794
|
-
|
795
|
-
end
|
796
|
-
|
898
|
+
end
|
797
899
|
end
|