metanorma-standoc 1.9.0 → 1.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/rake.yml +3 -13
  3. data/.hound.yml +3 -1
  4. data/.rubocop.yml +4 -8
  5. data/lib/asciidoctor/standoc/base.rb +31 -35
  6. data/lib/asciidoctor/standoc/biblio.rng +1 -0
  7. data/lib/asciidoctor/standoc/blocks.rb +25 -9
  8. data/lib/asciidoctor/standoc/blocks_notes.rb +41 -24
  9. data/lib/asciidoctor/standoc/cleanup.rb +59 -84
  10. data/lib/asciidoctor/standoc/cleanup_block.rb +63 -85
  11. data/lib/asciidoctor/standoc/cleanup_boilerplate.rb +28 -15
  12. data/lib/asciidoctor/standoc/cleanup_footnotes.rb +1 -0
  13. data/lib/asciidoctor/standoc/cleanup_image.rb +71 -0
  14. data/lib/asciidoctor/standoc/cleanup_inline.rb +117 -77
  15. data/lib/asciidoctor/standoc/cleanup_maths.rb +36 -27
  16. data/lib/asciidoctor/standoc/cleanup_ref.rb +31 -15
  17. data/lib/asciidoctor/standoc/cleanup_ref_dl.rb +1 -1
  18. data/lib/asciidoctor/standoc/cleanup_reqt.rb +47 -0
  19. data/lib/asciidoctor/standoc/cleanup_section.rb +77 -135
  20. data/lib/asciidoctor/standoc/cleanup_section_names.rb +75 -0
  21. data/lib/asciidoctor/standoc/cleanup_terms.rb +19 -18
  22. data/lib/asciidoctor/standoc/converter.rb +7 -2
  23. data/lib/asciidoctor/standoc/datamodel/plantuml_renderer.rb +67 -66
  24. data/lib/asciidoctor/standoc/front.rb +35 -18
  25. data/lib/asciidoctor/standoc/front_contributor.rb +70 -45
  26. data/lib/asciidoctor/standoc/inline.rb +45 -34
  27. data/lib/asciidoctor/standoc/isodoc.rng +209 -4
  28. data/lib/asciidoctor/standoc/lists.rb +4 -2
  29. data/lib/asciidoctor/standoc/macros.rb +11 -11
  30. data/lib/asciidoctor/standoc/macros_form.rb +63 -0
  31. data/lib/asciidoctor/standoc/macros_plantuml.rb +19 -21
  32. data/lib/asciidoctor/standoc/macros_terms.rb +33 -23
  33. data/lib/asciidoctor/standoc/ref.rb +87 -112
  34. data/lib/asciidoctor/standoc/ref_date_id.rb +62 -0
  35. data/lib/asciidoctor/standoc/ref_sect.rb +20 -17
  36. data/lib/asciidoctor/standoc/section.rb +3 -1
  37. data/lib/asciidoctor/standoc/term_lookup_cleanup.rb +40 -27
  38. data/lib/asciidoctor/standoc/terms.rb +25 -18
  39. data/lib/asciidoctor/standoc/utils.rb +35 -9
  40. data/lib/asciidoctor/standoc/validate.rb +48 -33
  41. data/lib/metanorma-standoc.rb +0 -1
  42. data/lib/metanorma/standoc/version.rb +1 -1
  43. data/metanorma-standoc.gemspec +4 -4
  44. data/spec/asciidoctor/base_spec.rb +701 -508
  45. data/spec/asciidoctor/blocks_spec.rb +831 -738
  46. data/spec/asciidoctor/cleanup_sections_spec.rb +51 -14
  47. data/spec/asciidoctor/cleanup_spec.rb +889 -682
  48. data/spec/asciidoctor/inline_spec.rb +62 -14
  49. data/spec/asciidoctor/isobib_cache_spec.rb +404 -358
  50. data/spec/asciidoctor/lists_spec.rb +149 -137
  51. data/spec/asciidoctor/macros_plantuml_spec.rb +8 -8
  52. data/spec/asciidoctor/macros_spec.rb +923 -503
  53. data/spec/asciidoctor/macros_yaml2text_spec.rb +1 -1
  54. data/spec/asciidoctor/refs_dl_spec.rb +4 -4
  55. data/spec/asciidoctor/refs_spec.rb +1528 -1533
  56. data/spec/asciidoctor/section_spec.rb +405 -299
  57. data/spec/asciidoctor/table_spec.rb +6 -6
  58. data/spec/asciidoctor/validate_spec.rb +342 -304
  59. data/spec/spec_helper.rb +13 -9
  60. data/spec/vcr_cassettes/dated_iso_ref_joint_iso_iec.yml +54 -54
  61. data/spec/vcr_cassettes/isobib_get_123.yml +13 -13
  62. data/spec/vcr_cassettes/isobib_get_123_1.yml +25 -25
  63. data/spec/vcr_cassettes/isobib_get_123_1_fr.yml +37 -37
  64. data/spec/vcr_cassettes/isobib_get_123_2001.yml +12 -12
  65. data/spec/vcr_cassettes/isobib_get_124.yml +13 -13
  66. data/spec/vcr_cassettes/rfcbib_get_rfc8341.yml +14 -14
  67. data/spec/vcr_cassettes/separates_iev_citations_by_top_level_clause.yml +46 -46
  68. metadata +16 -15
  69. data/lib/liquid/custom_blocks/key_iterator.rb +0 -21
  70. data/lib/liquid/custom_blocks/with_json_nested_context.rb +0 -18
  71. data/lib/liquid/custom_blocks/with_yaml_nested_context.rb +0 -19
  72. 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", backend: :standoc, header_footer: true)
5
+ output = Asciidoctor.convert(<<~"INPUT", *OPTIONS)
6
6
  #{ASCIIDOC_BLANK_HDR}
7
7
  * List 1
8
8
  * List 2
@@ -21,56 +21,56 @@ RSpec.describe Asciidoctor::Standoc do
21
21
 
22
22
  INPUT
23
23
  expect(xmlpp(strip_guid(output))).to be_equivalent_to xmlpp(<<~"OUTPUT")
24
- #{BLANK_HDR}
25
- <sections>
26
- <ul id='_'>
27
- <li>
28
- <p id='_'>List 1</p>
29
- </li>
30
- <li>
31
- <p id='_'>List 2</p>
32
- </li>
33
- <li>
34
- <p id='_'>List 3</p>
35
- </li>
36
- <li uncheckedcheckbox='false' checkedcheckbox='true'>
37
- <p id='_'>checked</p>
38
- </li>
39
- <li uncheckedcheckbox='false' checkedcheckbox='true'>
40
- <p id='_'>also checked</p>
41
- </li>
42
- <li uncheckedcheckbox='true' checkedcheckbox='false'>
43
- <p id='_'>not checked</p>
44
- <ol id='_' type='arabic'>
45
- <li>
46
- <p id='_'>List A</p>
47
- </li>
48
- <li>
49
- <p id='_'>List B</p>
50
- </li>
51
- <li>
52
- <p id='_'>List C</p>
53
- <dl id='_'>
54
- <dt>List D</dt>
55
- <dd>
56
- <p id='_'>List E</p>
57
- </dd>
58
- <dt>List F</dt>
59
- <dd>
60
- <p id='_'>List G</p>
61
- </dd>
62
- </dl>
63
- </li>
64
- </ol>
65
- </li>
66
- </ul>
67
- </sections>
68
- </standard-document>
24
+ #{BLANK_HDR}
25
+ <sections>
26
+ <ul id='_'>
27
+ <li>
28
+ <p id='_'>List 1</p>
29
+ </li>
30
+ <li>
31
+ <p id='_'>List 2</p>
32
+ </li>
33
+ <li>
34
+ <p id='_'>List 3</p>
35
+ </li>
36
+ <li uncheckedcheckbox='false' checkedcheckbox='true'>
37
+ <p id='_'>checked</p>
38
+ </li>
39
+ <li uncheckedcheckbox='false' checkedcheckbox='true'>
40
+ <p id='_'>also checked</p>
41
+ </li>
42
+ <li uncheckedcheckbox='true' checkedcheckbox='false'>
43
+ <p id='_'>not checked</p>
44
+ <ol id='_' type='arabic'>
45
+ <li>
46
+ <p id='_'>List A</p>
47
+ </li>
48
+ <li>
49
+ <p id='_'>List B</p>
50
+ </li>
51
+ <li>
52
+ <p id='_'>List C</p>
53
+ <dl id='_'>
54
+ <dt>List D</dt>
55
+ <dd>
56
+ <p id='_'>List E</p>
57
+ </dd>
58
+ <dt>List F</dt>
59
+ <dd>
60
+ <p id='_'>List G</p>
61
+ </dd>
62
+ </dl>
63
+ </li>
64
+ </ol>
65
+ </li>
66
+ </ul>
67
+ </sections>
68
+ </standard-document>
69
69
  OUTPUT
70
70
  end
71
71
 
72
- it "processes complex lists" do
73
- output = Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)
72
+ it "processes complex lists" do
73
+ output = Asciidoctor.convert(<<~"INPUT", *OPTIONS)
74
74
  #{ASCIIDOC_BLANK_HDR}
75
75
  [[id]]
76
76
  [keep-with-next=true,keep-lines-together=true]
@@ -116,99 +116,111 @@ RSpec.describe Asciidoctor::Standoc do
116
116
 
117
117
  INPUT
118
118
  expect(xmlpp(strip_guid(output))).to be_equivalent_to xmlpp(<<~"OUTPUT")
119
- #{BLANK_HDR}
120
- <sections><ul id="id" keep-with-next="true" keep-lines-together="true">
121
- <li>
122
- <p id="_">First</p>
123
- </li>
124
- <li><p id="_">Second</p><p id="_">entry1</p>
125
- <p id="_">entry2</p></li>
126
- </ul>
127
- <ol id="id1" type="alphabet" keep-with-next="true" keep-lines-together="true">
128
- <li>
129
- <p id="_">First</p>
130
- </li>
131
- <li>
132
- <p id="_">Second</p>
133
- <ol id="_" type="alphabet_upper">
134
- <li>
135
- <p id="_">Third</p>
136
- </li>
137
- <li>
138
- <p id="_">Fourth</p>
139
- </li>
140
- </ol>
141
- </li>
142
- <li>
143
- <p id="_">Fifth</p>
144
- </li>
145
- <li>
146
- <p id="_">Sixth</p>
147
- </li>
148
- </ol>
149
- <ol id="_" type="roman">
150
- <li>
151
- <p id="_">A</p>
152
- </li>
153
- <li>
154
- <p id="_">B</p>
155
- <ol id="_" type="roman_upper">
156
- <li>
157
- <p id="_">C</p>
158
- </li>
159
- <li>
160
- <p id="_">D</p>
161
- <ol id="_" type="arabic">
162
- <li>
163
- <p id="_">E</p>
164
- </li>
165
- <li>
166
- <p id="_">F</p>
167
-
168
- <dl id="_" keep-with-next="true" keep-lines-together="true">
169
- <dt>Notes1</dt>
170
- <dd/>
171
- <dt>Notes</dt>
172
- <dd><p id="_">Note 1.</p><p id="_">Note 2.</p>
173
- <p id="_">Note 3.</p></dd>
174
- </dl>
175
- </li>
176
- </ol>
177
- </li>
178
- </ol>
179
- </li>
180
- </ol><dl id='_' key='true'>
181
- <dt>a</dt>
182
- <dd>
183
- <p id='_'>b</p>
184
- </dd>
185
- </dl>
186
- </sections>
187
- </standard-document>
188
- OUTPUT
189
- end
119
+ #{BLANK_HDR}
120
+ <sections><ul id="id" keep-with-next="true" keep-lines-together="true">
121
+ <li>
122
+ <p id="_">First</p>
123
+ </li>
124
+ <li><p id="_">Second</p><p id="_">entry1</p>
125
+ <p id="_">entry2</p></li>
126
+ </ul>
127
+ <ol id="id1" type="alphabet" keep-with-next="true" keep-lines-together="true">
128
+ <li>
129
+ <p id="_">First</p>
130
+ </li>
131
+ <li>
132
+ <p id="_">Second</p>
133
+ <ol id="_" type="alphabet_upper">
134
+ <li>
135
+ <p id="_">Third</p>
136
+ </li>
137
+ <li>
138
+ <p id="_">Fourth</p>
139
+ </li>
140
+ </ol>
141
+ </li>
142
+ <li>
143
+ <p id="_">Fifth</p>
144
+ </li>
145
+ <li>
146
+ <p id="_">Sixth</p>
147
+ </li>
148
+ </ol>
149
+ <ol id="_" type="roman">
150
+ <li>
151
+ <p id="_">A</p>
152
+ </li>
153
+ <li>
154
+ <p id="_">B</p>
155
+ <ol id="_" type="roman_upper">
156
+ <li>
157
+ <p id="_">C</p>
158
+ </li>
159
+ <li>
160
+ <p id="_">D</p>
161
+ <ol id="_" type="arabic">
162
+ <li>
163
+ <p id="_">E</p>
164
+ </li>
165
+ <li>
166
+ <p id="_">F</p>
167
+ <dl id="_" keep-with-next="true" keep-lines-together="true">
168
+ <dt>Notes1</dt>
169
+ <dd/>
170
+ <dt>Notes</dt>
171
+ <dd><p id="_">Note 1.</p><p id="_">Note 2.</p>
172
+ <p id="_">Note 3.</p></dd>
173
+ </dl>
174
+ </li>
175
+ </ol>
176
+ </li>
177
+ </ol>
178
+ </li>
179
+ </ol><dl id='_' key='true'>
180
+ <dt>a</dt>
181
+ <dd>
182
+ <p id='_'>b</p>
183
+ </dd>
184
+ </dl>
185
+ </sections>
186
+ </standard-document>
187
+ OUTPUT
188
+ end
190
189
 
191
- it "anchors lists and list items" do
192
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
190
+ it "anchors lists and list items" do
191
+ input = <<~INPUT
193
192
  #{ASCIIDOC_BLANK_HDR}
194
193
  [[id1]]
195
194
  * [[id2]] List item
196
195
  * Hello [[id3]] List item
197
196
 
198
- INPUT
199
- #{BLANK_HDR}
200
- <sections>
201
- <ul id="id1">
202
- <li id="id2">
203
- <p id="_">List item</p>
204
- </li>
205
- <li>
206
- <p id="_">Hello <bookmark id="id3"/> List item</p>
207
- </li>
208
- </ul>
209
- </sections>
210
- </standard-document>
211
- OUTPUT
212
- end
213
-
197
+ [[id4]]
198
+ [[id5]]a:: [[id6]]b
199
+ INPUT
200
+ output = <<~OUTPUT
201
+ #{BLANK_HDR}
202
+ <sections>
203
+ <ul id="id1">
204
+ <li id="id2">
205
+ <p id="_">List item</p>
206
+ </li>
207
+ <li>
208
+ <p id="_">Hello <bookmark id="id3"/> List item</p>
209
+ </li>
210
+ </ul>
211
+ <dl id='id4'>
212
+ <dt id='id5'>a</dt>
213
+ <dd>
214
+ <p id='_'>
215
+ <bookmark id='id6'/>
216
+ b
217
+ </p>
218
+ </dd>
219
+ </dl>
220
+ </sections>
221
+ </standard-document>
222
+ OUTPUT
223
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
224
+ .to be_equivalent_to xmlpp(output)
225
+ end
214
226
  end
@@ -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", backend: :standoc, header_footer: true)).gsub(%r{plantuml/plantuml[^./]+\.}, "plantuml/_."))).to be_equivalent_to xmlpp(<<~"OUTPUT")
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", backend: :standoc, header_footer: true)).gsub(%r{spec/assets/[^./]+\.}, "spec/assets/_."))).to be_equivalent_to xmlpp(<<~"OUTPUT")
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, backend: :standoc, header_footer: true))
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, backend: :standoc, header_footer: true))))
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", backend: :standoc, header_footer: true) }.to output(%r{PlantUML not installed}).to_stderr
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", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
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 &lt;-- 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", backend: :standoc, header_footer: true) }.to output(%r{not writable for PlantUML}).to_stderr
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 &lt;-- Bob: another authentication Response
256
256
  INPUT
257
257
 
258
258
  mock_localdir_unwritable
259
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
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,7 +2,7 @@ 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", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
5
+ input = <<~INPUT
6
6
  #{ASCIIDOC_BLANK_HDR}
7
7
  alt:[term1]
8
8
  deprecated:[term1]
@@ -15,43 +15,46 @@ RSpec.describe Asciidoctor::Standoc do
15
15
  == Bibliography
16
16
  * [[[ref1,XYZ 123]]] _Title_
17
17
  INPUT
18
+ output = <<~OUTPUT
18
19
  #{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>
20
+ <preface>
21
+ <foreword id='_' obligation='informative'>
22
+ <title>Foreword</title>
23
+ <admitted>term1</admitted>
24
+ <deprecates>term1</deprecates>
25
+ <domain>term1</domain>
26
+ <inherit>
27
+ <eref type='inline' bibitemid='ref1' citeas='XYZ 123'/>
28
+ </inherit>
29
+ <autonumber type='table'>3</autonumber>
30
+ <add>
31
+ a
32
+ <xref target='clause'/>
33
+ </add>
34
+ <del>B</del>
35
+ </foreword>
36
+ </preface>
37
+ <sections> </sections>
38
+ <bibliography>
39
+ <references id='_' obligation='informative' normative="false">
40
+ <title>Bibliography</title>
41
+ <bibitem id='ref1'>
42
+ <formattedref format='application/x-isodoc+xml'>
43
+ <em>Title</em>
44
+ </formattedref>
45
+ <docidentifier>XYZ 123</docidentifier>
46
+ <docnumber>123</docnumber>
47
+ </bibitem>
48
+ </references>
49
+ </bibliography>
50
+ </standard-document>
50
51
  OUTPUT
52
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
53
+ .to be_equivalent_to xmlpp(output)
51
54
  end
52
55
 
53
56
  it "processes the Asciidoctor::Standoc index macros" do
54
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
57
+ input = <<~INPUT
55
58
  #{ASCIIDOC_BLANK_HDR}
56
59
  index:also[]
57
60
  index:see[A]
@@ -67,244 +70,448 @@ RSpec.describe Asciidoctor::Standoc do
67
70
 
68
71
  Text [[id3]]
69
72
  INPUT
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>
73
+ output = <<~OUTPUT
74
+ #{BLANK_HDR}
75
+ <sections>
76
+ <p id='_'>
77
+ <index-xref also='true'>
78
+ <primary>B</primary>
79
+ <target>
80
+ C
81
+ <sub>x</sub>
82
+ </target>
83
+ </index-xref>
84
+ <index-xref also='false'>
85
+ <primary>D</primary>
86
+ <secondary>
87
+ <em>E</em>
88
+ </secondary>
89
+ <target>F</target>
90
+ </index-xref>
91
+ <index-xref also='true'>
92
+ <primary>G</primary>
93
+ <secondary>H</secondary>
94
+ <tertiary>I</tertiary>
95
+ <target>J</target>
96
+ </index-xref>
97
+ P
98
+ <index to="id2">
99
+ <primary>P</primary>
100
+ </index>
101
+ <em>P</em>
102
+ <index to="id3">
103
+ <primary>
104
+ <em>P</em>
105
+ </primary>
106
+ </index>
107
+ <index to="id3">
108
+ <primary>Q</primary>
109
+ <secondary>R</secondary>
110
+ <tertiary>S</tertiary>
111
+ </index>
112
+ </p>
113
+ <p id='_'>
114
+ Text
115
+ <bookmark id='id2'/>
116
+ </p>
117
+ <p id='_'>
118
+ Text
119
+ <bookmark id='id3'/>
120
+ </p>
121
+ </sections>
122
+ </standard-document>
119
123
  OUTPUT
124
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
125
+ .to be_equivalent_to xmlpp(output)
120
126
  end
121
127
 
122
128
  it "processes the Asciidoctor::Standoc variant macros" do
123
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
129
+ input = <<~INPUT
124
130
  #{ASCIIDOC_BLANK_HDR}
125
131
  == lang:en[English] lang:fr-Latn[Français]
126
132
 
127
133
  this lang:en[English] lang:fr-Latn[Français] section is lang:en[silly] lang:fr[fou]
128
134
 
129
135
  INPUT
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>
136
+ output = <<~OUTPUT
137
+ #{BLANK_HDR}
138
+ <sections>
139
+ <clause id='_' inline-header='false' obligation='normative'>
140
+ <title>
141
+ <variant lang='en'>English</variant>
142
+ <variant lang='fr' script='Latn'>Français</variant>
143
+ </title>
144
+ <p id='_'>
145
+ this
146
+ <variant>
147
+ <variant lang='en'>English</variant>
148
+ <variant lang='fr' script='Latn'>Français</variant>
149
+ </variant>
150
+ section is
151
+ <variant>
152
+ <variant lang='en'>silly</variant>
153
+ <variant lang='fr'>fou</variant>
154
+ </variant>
155
+ </p>
156
+ </clause>
157
+ </sections>
158
+ </standard-document>
152
159
  OUTPUT
160
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
161
+ .to be_equivalent_to xmlpp(output)
153
162
  end
154
163
 
155
-
156
- it "processes the Asciidoctor::Standoc concept macros" do
157
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
164
+ it "processes the Asciidoctor::Standoc concept macros" do
165
+ input = <<~INPUT
158
166
  #{ASCIIDOC_BLANK_HDR}
159
167
  {{clause1}}
168
+ term:[clause1]
160
169
  {{clause1,w\[o\]rd}}
170
+ term:[clause1,w[o&#93;rd]
161
171
  {{clause1,w\[o\]rd,term}}
162
172
  {{blah}}
173
+ term:[blah]
163
174
  {{blah,word}}
164
- {{blah,word,term}}
165
- {{blah,clause=3.1}}
166
- {{blah,clause=3.1,word}}
167
- {{blah,clause=3.1,word,term}}
168
- {{blah,clause=3.1,figure=a}}
169
- {{blah,clause=3.1,figure=a,word}}
170
- {{blah,clause=3.1,figure=a,word,term}}
171
- {{IEV:135-13-13}}
172
- {{IEV:135-13-13,word}}
173
- {{IEV:135-13-13,word,term}}
175
+ term:[blah,word]
176
+ {{blah,term,word}}
174
177
 
175
178
  [[clause1]]
176
179
  == Clause
177
180
  Terms are defined here
181
+ INPUT
182
+ output = <<~OUTPUT
183
+ #{BLANK_HDR}
184
+ <preface>
185
+ <foreword id='_' obligation='informative'>
186
+ <title>Foreword</title>
187
+ <p id='_'>
188
+ <concept>
189
+ <strong>
190
+ term
191
+ <tt>clause1</tt>
192
+ not resolved via ID
193
+ <tt>clause1</tt>
194
+ </strong>
195
+ </concept>
196
+ <concept>
197
+ <strong>
198
+ term
199
+ <tt>clause1</tt>
200
+ not resolved via ID
201
+ <tt>clause1</tt>
202
+ </strong>
203
+ </concept>
204
+ <concept>
205
+ <strong>
206
+ term
207
+ <tt>clause1</tt>, display <tt>w[o]rd</tt>
208
+ not resolved via ID
209
+ <tt>clause1</tt>
210
+ </strong>
211
+ </concept>
212
+ <concept>
213
+ <strong>
214
+ term
215
+ <tt>clause1</tt>, display <tt>w[o]rd</tt>
216
+ not resolved via ID
217
+ <tt>clause1</tt>
218
+ </strong>
219
+ </concept>
220
+ <concept>
221
+ <strong>
222
+ term
223
+ <tt>clause1</tt>, display <tt>w[o]rd</tt>
224
+ not resolved via ID
225
+ <tt>clause1</tt>
226
+ </strong>
227
+ </concept>
228
+ <concept>
229
+ <strong>
230
+ term
231
+ <tt>blah</tt>
232
+ not resolved via ID
233
+ <tt>blah</tt>
234
+ </strong>
235
+ </concept>
236
+ <concept>
237
+ <strong>
238
+ term
239
+ <tt>blah</tt>
240
+ not resolved via ID
241
+ <tt>blah</tt>
242
+ </strong>
243
+ </concept>
244
+ <concept>
245
+ <strong>
246
+ term
247
+ <tt>blah</tt>
248
+ , display
249
+ <tt>word</tt>
250
+ not resolved via ID
251
+ <tt>blah</tt>
252
+ </strong>
253
+ </concept>
254
+ <concept>
255
+ <strong>
256
+ term
257
+ <tt>blah</tt>
258
+ , display
259
+ <tt>word</tt>
260
+ not resolved via ID
261
+ <tt>blah</tt>
262
+ </strong>
263
+ </concept>
264
+ <concept>
265
+ <strong>
266
+ term
267
+ <tt>blah</tt>
268
+ , display
269
+ <tt>term</tt>
270
+ not resolved via ID
271
+ <tt>blah</tt>
272
+ </strong>
273
+ </concept>
274
+ </p>
275
+ </foreword>
276
+ </preface>
277
+ <sections>
278
+ <clause id='clause1' inline-header='false' obligation='normative'>
279
+ <title>Clause</title>
280
+ <p id='_'>Terms are defined here</p>
281
+ </clause>
282
+ </sections>
283
+ </standard-document>
284
+ OUTPUT
285
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
286
+ .to be_equivalent_to xmlpp(output)
287
+ end
288
+
289
+ it "processes the concept macros with xrefs" do
290
+ input = <<~INPUT
291
+ #{ASCIIDOC_BLANK_HDR}
292
+ {{<<clause1>>}}
293
+ {{<<clause1>>,w\[o\]rd}}
294
+ {{<<clause1>>,term,w\[o\]rd}}
295
+ {{<<clause1>>,term,w\[o\]rd,Clause #1}}
296
+
297
+ [[clause1]]
298
+ == Clause
299
+ Terms are defined here
300
+ INPUT
301
+ output = <<~OUTPUT
302
+ #{BLANK_HDR}
303
+ <preface>
304
+ <foreword id='_' obligation='informative'>
305
+ <title>Foreword</title>
306
+ <p id='_'>
307
+ <concept>
308
+ <xref target='clause1'/>
309
+ </concept>
310
+ <concept>
311
+ <refterm>w[o]rd</refterm>
312
+ <renderterm>w[o]rd</renderterm>
313
+ <xref target='clause1'/>
314
+ </concept>
315
+ <concept>
316
+ <refterm>term</refterm>
317
+ <renderterm>w[o]rd</renderterm>
318
+ <xref target='clause1'/>
319
+ </concept>
320
+ <concept>
321
+ <refterm>term</refterm>
322
+ <renderterm>w[o]rd</renderterm>
323
+ <xref target='clause1'>Clause #1</xref>
324
+ </concept>
325
+ </p>
326
+ </foreword>
327
+ </preface>
328
+ <sections>
329
+ <clause id='clause1' inline-header='false' obligation='normative'>
330
+ <title>Clause</title>
331
+ <p id='_'>Terms are defined here</p>
332
+ </clause>
333
+ </sections>
334
+ </standard-document>
335
+ OUTPUT
336
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
337
+ .to be_equivalent_to xmlpp(output)
338
+ end
339
+
340
+ it "processes the concept macros with erefs" do
341
+ input = <<~INPUT
342
+ #{ASCIIDOC_BLANK_HDR}
343
+ {{<<blah>>}}
344
+ {{<<blah>>,word}}
345
+ {{<<blah>>,term,word}}
346
+ {{<<blah>>,term,word,Clause #1}}
347
+ {{<<blah,clause=3.1>>}}
348
+ {{<<blah,clause=3.1>>,word}}
349
+ {{<<blah,clause=3.1>>,term,word}}
350
+ {{<<blah,clause=3.1,figure=a>>}}
351
+ {{<<blah,clause=3.1,figure=a>>,word}}
352
+ {{<<blah,clause=3.1,figure=a>>,term,word,Clause #1}}
178
353
 
179
354
  [bibliography]
180
355
  == Bibliography
181
356
  * [[[blah,blah]]] _Blah_
182
- INPUT
183
- #{BLANK_HDR}
184
- <preface>
185
- <foreword id='_' obligation='informative'>
186
- <title>Foreword</title>
187
- <p id='_'>
188
- <concept>
189
- <xref target='clause1'/>
190
- </concept>
191
- <concept>
192
- <xref target='clause1'>w[o]rd</xref>
193
- </concept>
194
- <concept term='term'>
195
- <xref target='clause1'>w[o]rd</xref>
196
- </concept>
197
- <concept>
198
- <eref/>
199
- </concept>
200
- <concept>
201
- <eref>word</eref>
202
- </concept>
203
- <concept term='term'>
204
- <eref>word</eref>
205
- </concept>
206
- <concept>
207
- <eref>
208
- <localityStack>
209
- <locality type='clause'>
210
- <referenceFrom>3.1</referenceFrom>
211
- </locality>
212
- </localityStack>
213
- </eref>
214
- </concept>
215
- <concept>
216
- <eref>
217
- <localityStack>
218
- <locality type='clause'>
219
- <referenceFrom>3.1</referenceFrom>
220
- </locality>
221
- </localityStack>
222
- word
223
- </eref>
224
- </concept>
225
- <concept term='term'>
226
- <eref>
227
- <localityStack>
228
- <locality type='clause'>
229
- <referenceFrom>3.1</referenceFrom>
230
- </locality>
231
- </localityStack>
232
- word
233
- </eref>
234
- </concept>
235
- <concept>
236
- <eref>
237
- <localityStack>
238
- <locality type='clause'>
239
- <referenceFrom>3.1</referenceFrom>
240
- </locality>
241
- <locality type='figure'>
242
- <referenceFrom>a</referenceFrom>
243
- </locality>
244
- </localityStack>
245
- </eref>
246
- </concept>
247
- <concept>
248
- <eref>
249
- <localityStack>
250
- <locality type='clause'>
251
- <referenceFrom>3.1</referenceFrom>
252
- </locality>
253
- <locality type='figure'>
254
- <referenceFrom>a</referenceFrom>
255
- </locality>
256
- </localityStack>
257
- word
258
- </eref>
259
- </concept>
260
- <concept term='term'>
261
- <eref>
262
- <localityStack>
263
- <locality type='clause'>
264
- <referenceFrom>3.1</referenceFrom>
265
- </locality>
266
- <locality type='figure'>
267
- <referenceFrom>a</referenceFrom>
268
- </locality>
269
- </localityStack>
270
- word
271
- </eref>
272
- </concept>
273
- <concept>
274
- <termref base='IEV' target='135-13-13'/>
275
- </concept>
276
- <concept>
277
- <termref base='IEV' target='135-13-13'>word</termref>
278
- </concept>
279
- <concept term='term'>
280
- <termref base='IEV' target='135-13-13'>word</termref>
281
- </concept>
282
- </p>
283
- </foreword>
284
- </preface>
285
- <sections>
286
- <clause id='clause1' inline-header='false' obligation='normative'>
287
- <title>Clause</title>
288
- <p id='_'>Terms are defined here</p>
289
- </clause>
290
- </sections>
291
- <bibliography>
292
- <references id='_' obligation='informative' normative="false">
293
- <title>Bibliography</title>
294
- <bibitem id='blah'>
295
- <formattedref format='application/x-isodoc+xml'>
296
- <em>Blah</em>
297
- </formattedref>
298
- <docidentifier>blah</docidentifier>
299
- </bibitem>
300
- </references>
301
- </bibliography>
302
- </standard-document>
303
- OUTPUT
304
- end
357
+ INPUT
358
+ output = <<~OUTPUT
359
+ #{BLANK_HDR}
360
+ <preface>
361
+ <foreword id='_' obligation='informative'>
362
+ <title>Foreword</title>
363
+ <p id='_'>
364
+ <concept>
365
+ <eref bibitemid='blah'/>
366
+ </concept>
367
+ <concept>
368
+ <refterm>word</refterm>
369
+ <renderterm>word</renderterm>
370
+ <eref bibitemid='blah'/>
371
+ </concept>
372
+ <concept>
373
+ <refterm>term</refterm>
374
+ <renderterm>word</renderterm>
375
+ <eref bibitemid='blah'/>
376
+ </concept>
377
+ <concept>
378
+ <refterm>term</refterm>
379
+ <renderterm>word</renderterm>
380
+ <eref bibitemid='blah'>Clause #1</eref>
381
+ </concept>
382
+ <concept>
383
+ <eref bibitemid='blah'>
384
+ <localityStack>
385
+ <locality type='clause'>
386
+ <referenceFrom>3.1</referenceFrom>
387
+ </locality>
388
+ </localityStack>
389
+ </eref>
390
+ </concept>
391
+ <concept>
392
+ <refterm>word</refterm>
393
+ <renderterm>word</renderterm>
394
+ <eref bibitemid='blah'>
395
+ <localityStack>
396
+ <locality type='clause'>
397
+ <referenceFrom>3.1</referenceFrom>
398
+ </locality>
399
+ </localityStack>
400
+ </eref>
401
+ </concept>
402
+ <concept>
403
+ <refterm>term</refterm>
404
+ <renderterm>word</renderterm>
405
+ <eref bibitemid='blah'>
406
+ <localityStack>
407
+ <locality type='clause'>
408
+ <referenceFrom>3.1</referenceFrom>
409
+ </locality>
410
+ </localityStack>
411
+ </eref>
412
+ </concept>
413
+ <concept>
414
+ <eref bibitemid='blah'>
415
+ <localityStack>
416
+ <locality type='clause'>
417
+ <referenceFrom>3.1</referenceFrom>
418
+ </locality>
419
+ <locality type='figure'>
420
+ <referenceFrom>a</referenceFrom>
421
+ </locality>
422
+ </localityStack>
423
+ </eref>
424
+ </concept>
425
+ <concept>
426
+ <refterm>word</refterm>
427
+ <renderterm>word</renderterm>
428
+ <eref bibitemid='blah'>
429
+ <localityStack>
430
+ <locality type='clause'>
431
+ <referenceFrom>3.1</referenceFrom>
432
+ </locality>
433
+ <locality type='figure'>
434
+ <referenceFrom>a</referenceFrom>
435
+ </locality>
436
+ </localityStack>
437
+ </eref>
438
+ </concept>
439
+ <concept>
440
+ <refterm>term</refterm>
441
+ <renderterm>word</renderterm>
442
+ <eref bibitemid='blah'>
443
+ <localityStack>
444
+ <locality type='clause'>
445
+ <referenceFrom>3.1</referenceFrom>
446
+ </locality>
447
+ <locality type='figure'>
448
+ <referenceFrom>a</referenceFrom>
449
+ </locality>
450
+ </localityStack>
451
+ Clause #1
452
+ </eref>
453
+ </concept>
454
+ </p>
455
+ </foreword>
456
+ </preface>
457
+ <sections> </sections>
458
+ <bibliography>
459
+ <references id='_' normative='false' obligation='informative'>
460
+ <title>Bibliography</title>
461
+ <bibitem id='blah'>
462
+ <formattedref format='application/x-isodoc+xml'>
463
+ <em>Blah</em>
464
+ </formattedref>
465
+ <docidentifier>blah</docidentifier>
466
+ </bibitem>
467
+ </references>
468
+ </bibliography>
469
+ </standard-document>
470
+ OUTPUT
471
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
472
+ .to be_equivalent_to xmlpp(output)
473
+ end
474
+
475
+ it "processes the concept macros with termbase" do
476
+ input = <<~INPUT
477
+ #{ASCIIDOC_BLANK_HDR}
478
+ {{<<IEV:135-13-13>>}}
479
+ {{<<IEV:135-13-13>>,word}}
480
+ {{<<IEV:135-13-13>>,term,word}}
481
+ {{<<IEV:135-13-13>>,term,word,Clause #1}}
482
+ INPUT
483
+ output = <<~OUTPUT
484
+ #{BLANK_HDR}
485
+ <sections>
486
+ <p id='_'>
487
+ <concept>
488
+ <termref base='IEV' target='135-13-13'/>
489
+ </concept>
490
+ <concept>
491
+ <refterm>word</refterm>
492
+ <renderterm>word</renderterm>
493
+ <termref base='IEV' target='135-13-13'/>
494
+ </concept>
495
+ <concept>
496
+ <refterm>term</refterm>
497
+ <renderterm>word</renderterm>
498
+ <termref base='IEV' target='135-13-13'/>
499
+ </concept>
500
+ <concept>
501
+ <refterm>term</refterm>
502
+ <renderterm>word</renderterm>
503
+ <termref base='IEV' target='135-13-13'>Clause #1</termref>
504
+ </concept>
505
+ </p>
506
+ </sections>
507
+ </standard-document>
508
+ OUTPUT
509
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
510
+ .to be_equivalent_to xmlpp(output)
511
+ end
305
512
 
306
513
  it "processes the TODO custom admonition" do
307
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
514
+ input = <<~INPUT
308
515
  #{ASCIIDOC_BLANK_HDR}
309
516
  TODO: Note1
310
517
 
@@ -316,160 +523,175 @@ OUTPUT
316
523
  [TODO]
317
524
  Note3
318
525
  INPUT
319
- #{BLANK_HDR}
320
- <sections><review reviewer="(Unknown)" id="_" date="#{Date.today}T00:00:00Z">
321
- <p id="_"/>
322
- </review>
323
- <review reviewer="(Unknown)" id="_" date="#{Date.today}T00:00:00Z">
324
- <p id="_">Note2</p>
325
- </review>
326
- <review reviewer="(Unknown)" id="_" date="#{Date.today}T00:00:00Z">
327
- <p id="_">Note3</p>
328
- </review></sections>
329
- </standard-document>
526
+ output = <<~OUTPUT
527
+ #{BLANK_HDR}
528
+ <sections><review reviewer="(Unknown)" id="_" date="#{Date.today}T00:00:00Z">
529
+ <p id="_"/>
530
+ </review>
531
+ <review reviewer="(Unknown)" id="_" date="#{Date.today}T00:00:00Z">
532
+ <p id="_">Note2</p>
533
+ </review>
534
+ <review reviewer="(Unknown)" id="_" date="#{Date.today}T00:00:00Z">
535
+ <p id="_">Note3</p>
536
+ </review></sections>
537
+ </standard-document>
330
538
  OUTPUT
539
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
540
+ .to be_equivalent_to xmlpp(output)
331
541
  end
332
542
 
333
543
  it "generates pseudocode examples, with formatting and initial indentation" do
334
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
335
- #{ASCIIDOC_BLANK_HDR}
544
+ input = <<~INPUT
545
+ #{ASCIIDOC_BLANK_HDR}
336
546
 
337
- [pseudocode,subsequence="A",number="3",keep-with-next=true,keep-lines-together=true]
338
- [%unnumbered]
339
- ====
340
- *A* +
341
- [smallcap]#B#
547
+ [pseudocode,subsequence="A",number="3",keep-with-next=true,keep-lines-together=true]
548
+ [%unnumbered]
549
+ ====
550
+ *A* +
551
+ [smallcap]#B#
342
552
 
343
- _C_
344
- ====
345
- INPUT
346
- #{BLANK_HDR}
347
- <sections>
348
- <figure id="_" subsequence='A' class="pseudocode" unnumbered="true" number="3" keep-with-next="true" keep-lines-together="true">
349
- <p id="_">  <strong>A</strong><br/>
350
-         <smallcap>B</smallcap></p>
351
- <p id="_">  <em>C</em></p></figure>
352
- </sections>
353
- </standard-document>
354
- OUTPUT
355
- end
553
+ _C_
554
+ ====
555
+ INPUT
556
+ output = <<~OUTPUT
557
+ #{BLANK_HDR}
558
+ <sections>
559
+ <figure id="_" subsequence='A' class="pseudocode" unnumbered="true" number="3" keep-with-next="true" keep-lines-together="true">
560
+ <p id="_">  <strong>A</strong><br/>
561
+         <smallcap>B</smallcap></p>
562
+ <p id="_">  <em>C</em></p></figure>
563
+ </sections>
564
+ </standard-document>
565
+ OUTPUT
566
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
567
+ .to be_equivalent_to xmlpp(output)
568
+ end
356
569
 
357
- it "supplies line breaks in pseudocode" do
358
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
359
- #{ASCIIDOC_BLANK_HDR}
570
+ it "supplies line breaks in pseudocode" do
571
+ input = <<~INPUT
572
+ #{ASCIIDOC_BLANK_HDR}
360
573
 
361
- [pseudocode]
362
- ====
363
- A
364
- B
574
+ [pseudocode]
575
+ ====
576
+ A
577
+ B
365
578
 
366
- D
367
- E
368
- ====
369
- INPUT
370
- #{BLANK_HDR}
371
- <sections>
372
- <figure id='_' class='pseudocode'>
373
- <p id='_'>
374
- A
375
- <br/>
376
- B
377
- </p>
378
- <p id='_'>
379
- D
380
- <br/>
381
- E
382
- </p>
383
- </figure>
384
- </sections>
385
- </standard-document>
386
- OUTPUT
387
- end
579
+ D
580
+ E
581
+ ====
582
+ INPUT
583
+ output = <<~OUTPUT
584
+ #{BLANK_HDR}
585
+ <sections>
586
+ <figure id='_' class='pseudocode'>
587
+ <p id='_'>
588
+ A
589
+ <br/>
590
+ B
591
+ </p>
592
+ <p id='_'>
593
+ D
594
+ <br/>
595
+ E
596
+ </p>
597
+ </figure>
598
+ </sections>
599
+ </standard-document>
600
+ OUTPUT
601
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
602
+ .to be_equivalent_to xmlpp(output)
603
+ end
388
604
 
389
- it "skips embedded blocks when supplying line breaks in pseudocode" do
390
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
391
- #{ASCIIDOC_BLANK_HDR}
605
+ it "skips embedded blocks when supplying line breaks in pseudocode" do
606
+ input = <<~INPUT
607
+ #{ASCIIDOC_BLANK_HDR}
392
608
 
393
- [pseudocode]
394
- ====
395
- [stem]
396
- ++++
397
- bar X' = (1)/(v) sum_(i = 1)^(v) t_(i)
398
- ++++
399
- ====
400
- INPUT
401
- #{BLANK_HDR}
402
- <sections>
403
- <figure id='_' class='pseudocode'>
404
- <formula id='_'>
405
- <stem type='MathML'>
406
- <math xmlns='http://www.w3.org/1998/Math/MathML'>
407
- <mover accent="true">
408
- <mrow>
409
- <mi>X</mi>
410
- </mrow>
411
- <mo>¯</mo>
412
- </mover>
413
- <mo>′</mo>
414
- <mo>=</mo>
415
- <mfrac>
416
- <mrow>
417
- <mn>1</mn>
418
- </mrow>
419
- <mrow>
420
- <mi>v</mi>
421
- </mrow>
422
- </mfrac>
423
- <munderover>
424
- <mrow>
425
- <mo>∑</mo>
426
- </mrow>
427
- <mrow>
428
- <mrow>
429
- <mi>i</mi>
609
+ [pseudocode]
610
+ ====
611
+ [stem]
612
+ ++++
613
+ bar X' = (1)/(v) sum_(i = 1)^(v) t_(i)
614
+ ++++
615
+ ====
616
+ INPUT
617
+ output = <<~OUTPUT
618
+ #{BLANK_HDR}
619
+ <sections>
620
+ <figure id='_' class='pseudocode'>
621
+ <formula id='_'>
622
+ <stem type='MathML'>
623
+ <math xmlns='http://www.w3.org/1998/Math/MathML'>
624
+ <mover accent="true">
625
+ <mrow>
626
+ <mi>X</mi>
627
+ </mrow>
628
+ <mo>¯</mo>
629
+ </mover>
630
+ <mo>′</mo>
430
631
  <mo>=</mo>
431
- <mn>1</mn>
432
- </mrow>
433
- </mrow>
434
- <mrow>
435
- <mi>v</mi>
436
- </mrow>
437
- </munderover>
438
- <msub>
439
- <mrow>
440
- <mi>t</mi>
441
- </mrow>
442
- <mrow>
443
- <mi>i</mi>
444
- </mrow>
445
- </msub>
446
- </math>
447
- </stem>
448
- </formula>
449
- </figure>
450
- </sections>
451
- </standard-document>
452
- OUTPUT
453
- end
632
+ <mfrac>
633
+ <mrow>
634
+ <mn>1</mn>
635
+ </mrow>
636
+ <mrow>
637
+ <mi>v</mi>
638
+ </mrow>
639
+ </mfrac>
640
+ <munderover>
641
+ <mrow>
642
+ <mo>∑</mo>
643
+ </mrow>
644
+ <mrow>
645
+ <mrow>
646
+ <mi>i</mi>
647
+ <mo>=</mo>
648
+ <mn>1</mn>
649
+ </mrow>
650
+ </mrow>
651
+ <mrow>
652
+ <mi>v</mi>
653
+ </mrow>
654
+ </munderover>
655
+ <msub>
656
+ <mrow>
657
+ <mi>t</mi>
658
+ </mrow>
659
+ <mrow>
660
+ <mi>i</mi>
661
+ </mrow>
662
+ </msub>
663
+ </math>
664
+ </stem>
665
+ </formula>
666
+ </figure>
667
+ </sections>
668
+ </standard-document>
669
+ OUTPUT
670
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
671
+ .to be_equivalent_to xmlpp(output)
672
+ end
454
673
 
455
674
  it "processes the Ruby markups" do
456
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
675
+ input = <<~INPUT
457
676
  #{ASCIIDOC_BLANK_HDR}
458
677
 
459
678
  ruby:楽聖少女[がくせいしょうじょ]
460
679
  INPUT
461
- #{BLANK_HDR}
462
- <sections>
463
- <p id="_">
464
- <ruby>楽聖少女<rp>(</rp><rt>がくせいしょうじょ</rt><rp>)</rp></ruby>
465
- </p>
466
- </sections>
467
- </standard-document>
680
+ output = <<~OUTPUT
681
+ #{BLANK_HDR}
682
+ <sections>
683
+ <p id="_">
684
+ <ruby>楽聖少女<rp>(</rp><rt>がくせいしょうじょ</rt><rp>)</rp></ruby>
685
+ </p>
686
+ </sections>
687
+ </standard-document>
468
688
  OUTPUT
689
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
690
+ .to be_equivalent_to xmlpp(output)
469
691
  end
470
692
 
471
693
  it "processes the footnoteblock macro" do
472
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
694
+ input = <<~INPUT
473
695
  #{ASCIIDOC_BLANK_HDR}
474
696
 
475
697
  footnoteblock:[id1]
@@ -488,44 +710,47 @@ OUTPUT
488
710
  * C
489
711
  --
490
712
  INPUT
491
- #{BLANK_HDR}
492
- <sections>
493
- <p id="_">
494
- <fn reference='1'>
495
- <table id='_'>
496
- <thead>
497
- <tr>
498
- <th valign='top' align='left'>a</th>
499
- <th valign='top' align='left'>b</th>
500
- </tr>
501
- </thead>
502
- <tbody>
503
- <tr>
504
- <td valign='top' align='left'>c</td>
505
- <td valign='top' align='left'>d</td>
506
- </tr>
507
- </tbody>
508
- </table>
509
- <ul id='_'>
510
- <li>
511
- <p id='_'>A</p>
512
- </li>
513
- <li>
514
- <p id='_'>B</p>
515
- </li>
516
- <li>
517
- <p id='_'>C</p>
518
- </li>
519
- </ul>
520
- </fn>
521
- </p>
522
- </sections>
523
- </standard-document>
713
+ output = <<~OUTPUT
714
+ #{BLANK_HDR}
715
+ <sections>
716
+ <p id="_">
717
+ <fn reference='1'>
718
+ <table id='_'>
719
+ <thead>
720
+ <tr>
721
+ <th valign='top' align='left'>a</th>
722
+ <th valign='top' align='left'>b</th>
723
+ </tr>
724
+ </thead>
725
+ <tbody>
726
+ <tr>
727
+ <td valign='top' align='left'>c</td>
728
+ <td valign='top' align='left'>d</td>
729
+ </tr>
730
+ </tbody>
731
+ </table>
732
+ <ul id='_'>
733
+ <li>
734
+ <p id='_'>A</p>
735
+ </li>
736
+ <li>
737
+ <p id='_'>B</p>
738
+ </li>
739
+ <li>
740
+ <p id='_'>C</p>
741
+ </li>
742
+ </ul>
743
+ </fn>
744
+ </p>
745
+ </sections>
746
+ </standard-document>
524
747
  OUTPUT
748
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
749
+ .to be_equivalent_to xmlpp(output)
525
750
  end
526
751
 
527
- it "processes the footnoteblock macro with failed reference" do
528
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
752
+ it "processes the footnoteblock macro with failed reference" do
753
+ input = <<~INPUT
529
754
  #{ASCIIDOC_BLANK_HDR}
530
755
 
531
756
  footnoteblock:[id1]
@@ -544,60 +769,168 @@ OUTPUT
544
769
  * C
545
770
  --
546
771
  INPUT
547
- #{BLANK_HDR}
772
+ output = <<~OUTPUT
773
+ #{BLANK_HDR}
774
+ <sections>
775
+ <p id='_'>
776
+ <fn reference='1'>[ERROR]</fn>
777
+ </p>
778
+ <note id='id2'>
779
+ <table id='_'>
780
+ <thead>
781
+ <tr>
782
+ <th valign='top' align='left'>a</th>
783
+ <th valign='top' align='left'>b</th>
784
+ </tr>
785
+ </thead>
786
+ <tbody>
787
+ <tr>
788
+ <td valign='top' align='left'>c</td>
789
+ <td valign='top' align='left'>d</td>
790
+ </tr>
791
+ </tbody>
792
+ </table>
793
+ <ul id='_'>
794
+ <li>
795
+ <p id='_'>A</p>
796
+ </li>
797
+ <li>
798
+ <p id='_'>B</p>
799
+ </li>
800
+ <li>
801
+ <p id='_'>C</p>
802
+ </li>
803
+ </ul>
804
+ </note>
805
+ </sections>
806
+ </standard-document>
807
+ OUTPUT
808
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
809
+ .to be_equivalent_to xmlpp(output)
810
+ end
811
+
812
+ it "processes input form macros" do
813
+ input = <<~INPUT
814
+ #{ASCIIDOC_BLANK_HDR}
815
+
816
+ [form,id=N0,name=N1,action="/action_page.php"]
817
+ --
818
+ label:fname[First name:] +
819
+ input:text[id=fname,name=fname] +
820
+ label:lname[Last name:] +
821
+ input:text[id=lname,name=lname] +
822
+ label:pwd[Password:] +
823
+ input:password[id=pwd,name=pwd] +
824
+ input:radio[id=male,name=gender,value=male]
825
+ label:male[Male] +
826
+ input:radio[id=female,name=gender,value=female]
827
+ label:female[Female] +
828
+ input:radio[id=other,name=gender,value=other]
829
+ label:other[Other] +
830
+ input:checkbox[id=vehicle1,name=vehicle1,value=Bike,checked=true]
831
+ label:vehicle1[I have a bike] +
832
+ input:checkbox[id=vehicle2,name=vehicle2,value=Car]
833
+ label:vehicle2[I have a car] +
834
+ input:checkbox[id=vehicle3,name=vehicle3,value=Boat]
835
+ label:vehicle3[I have a boat] +
836
+ input:date[id=birthday,name=birthday] +
837
+ label:myfile[Select a file:]
838
+ input:file[id=myfile,name=myfile] +
839
+ label:cars[Select a car:] +
840
+ select:[id=cars,name=cars,value=fiat,size=4,disabled=true,multiple=true]
841
+ option:[Volvo,value=volvo,disabled=true]
842
+ option:[Saab,value=saab]
843
+ option:[Fiat,value=fiat]
844
+ option:[Audi,value=audi]
845
+ textarea:[id=t1,name=message,rows=10,cols=30,value="The cat was playing in the garden."]
846
+ input:button[value="Click Me!"]
847
+ input:button[]
848
+ input:submit[value="Submit"]
849
+ --
850
+ INPUT
851
+ output = <<~OUTPUT
852
+ #{BLANK_HDR}
548
853
  <sections>
549
- <p id='_'>
550
- <fn reference='1'>[ERROR]</fn>
551
- </p>
552
- <note id='id2'>
553
- <table id='_'>
554
- <thead>
555
- <tr>
556
- <th valign='top' align='left'>a</th>
557
- <th valign='top' align='left'>b</th>
558
- </tr>
559
- </thead>
560
- <tbody>
561
- <tr>
562
- <td valign='top' align='left'>c</td>
563
- <td valign='top' align='left'>d</td>
564
- </tr>
565
- </tbody>
566
- </table>
567
- <ul id='_'>
568
- <li>
569
- <p id='_'>A</p>
570
- </li>
571
- <li>
572
- <p id='_'>B</p>
573
- </li>
574
- <li>
575
- <p id='_'>C</p>
576
- </li>
577
- </ul>
578
- </note>
579
- </sections>
580
- </standard-document>
854
+ <form id='_' name='N1' action='/action_page.php'>
855
+ <p id='_'>
856
+ <label for='fname'>First name:</label>
857
+ <br/>
858
+ <input type='text' id='fname' name='fname'/>
859
+ <br/>
860
+ <label for='lname'>Last name:</label>
861
+ <br/>
862
+ <input type='text' id='lname' name='lname'/>
863
+ <br/>
864
+ <label for='pwd'>Password:</label>
865
+ <br/>
866
+ <input type='password' id='pwd' name='pwd'/>
867
+ <br/>
868
+ <input type='radio' id='male' name='gender' value='male'/>
869
+ <label for='male'>Male</label>
870
+ <br/>
871
+ <input type='radio' id='female' name='gender' value='female'/>
872
+ <label for='female'>Female</label>
873
+ <br/>
874
+ <input type='radio' id='other' name='gender' value='other'/>
875
+ <label for='other'>Other</label>
876
+ <br/>
877
+ <input type='checkbox' id='vehicle1' name='vehicle1' value='Bike' checked='true'/>
878
+ <label for='vehicle1'>I have a bike</label>
879
+ <br/>
880
+ <input type='checkbox' id='vehicle2' name='vehicle2' value='Car'/>
881
+ <label for='vehicle2'>I have a car</label>
882
+ <br/>
883
+ <input type='checkbox' id='vehicle3' name='vehicle3' value='Boat'/>
884
+ <label for='vehicle3'>I have a boat</label>
885
+ <br/>
886
+ <input type='date' id='birthday' name='birthday'/>
887
+ <br/>
888
+ <label for='myfile'>Select a file:</label>
889
+ <input type='file' id='myfile' name='myfile'/>
890
+ <br/>
891
+ <label for='cars'>Select a car:</label>
892
+ <br/>
893
+ <select id='cars' name='cars' size='4' disabled='true' multiple='true' value='fiat'>
894
+ <option disabled='true' value='volvo'/>
895
+ <option value='saab'/>
896
+ <option value='fiat'/>
897
+ <option value='audi'/>
898
+ </select>
899
+ <textarea id='t1' name='message' rows='10' cols='30' value='The cat was playing in the garden.'/>
900
+ <input type='button' value='Click Me!'/>
901
+ <input type='button'/>
902
+ <input type='submit' value='Submit'/>
903
+ </p>
904
+ </form>
905
+ </sections>
906
+ </standard-document>
581
907
  OUTPUT
908
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
909
+ .to be_equivalent_to xmlpp(output)
582
910
  end
583
911
 
584
- describe 'term inline macros' do
912
+ describe "term inline macros" do
585
913
  subject(:convert) do
586
914
  xmlpp(
587
915
  strip_guid(
588
916
  Asciidoctor.convert(
589
- input, backend: :standoc, header_footer: true)))
917
+ input, *OPTIONS
918
+ ),
919
+ ),
920
+ )
590
921
  end
591
922
  let(:input) do
592
923
  <<~XML
593
924
  #{ASCIIDOC_BLANK_HDR}
594
925
  == Terms and Definitions
595
926
 
596
- === name2
927
+ === name
597
928
 
598
929
  == Main
599
930
 
600
931
  term:[name,name2] is a term
932
+
933
+ {{name,name2}} is a term
601
934
  XML
602
935
  end
603
936
  let(:output) do
@@ -607,17 +940,27 @@ OUTPUT
607
940
  <terms id='_' obligation='normative'>
608
941
  <title>Terms and definitions</title>
609
942
  <p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
610
- <term id='term-name2'>
611
- <preferred>name2</preferred>
943
+ <term id='term-name'>
944
+ <preferred>name</preferred>
612
945
  </term>
613
946
  </terms>
614
947
  <clause id='_' inline-header='false' obligation='normative'>
615
948
  <title>Main</title>
616
949
  <p id='_'>
617
- <em>name</em>
618
- (
619
- <xref target='term-name2'/>
620
- ) is a term
950
+ <concept>
951
+ <refterm>name</refterm>
952
+ <renderterm>name2</renderterm>
953
+ <xref target='term-name'/>
954
+ </concept>
955
+ is a term
956
+ </p>
957
+ <p id='_'>
958
+ <concept>
959
+ <refterm>name</refterm>
960
+ <renderterm>name2</renderterm>
961
+ <xref target='term-name'/>
962
+ </concept>
963
+ is a term
621
964
  </p>
622
965
  </clause>
623
966
  </sections>
@@ -625,11 +968,11 @@ OUTPUT
625
968
  XML
626
969
  end
627
970
 
628
- it 'converts macro into the correct xml' do
971
+ it "converts macro into the correct xml" do
629
972
  expect(convert).to(be_equivalent_to(xmlpp(output)))
630
973
  end
631
974
 
632
- context 'default params' do
975
+ context "default params" do
633
976
  let(:input) do
634
977
  <<~XML
635
978
  #{ASCIIDOC_BLANK_HDR}
@@ -641,6 +984,8 @@ OUTPUT
641
984
  == Main
642
985
 
643
986
  term:[name] is a term
987
+
988
+ {{name}} is a term
644
989
  XML
645
990
  end
646
991
  let(:output) do
@@ -657,10 +1002,20 @@ OUTPUT
657
1002
  <clause id='_' inline-header='false' obligation='normative'>
658
1003
  <title>Main</title>
659
1004
  <p id='_'>
660
- <em>name</em>
661
- (
662
- <xref target='term-name' />
663
- ) is a term
1005
+ <concept>
1006
+ <refterm>name</refterm>
1007
+ <renderterm>name</renderterm>
1008
+ <xref target='term-name'/>
1009
+ </concept>
1010
+ is a term
1011
+ </p>
1012
+ <p id='_'>
1013
+ <concept>
1014
+ <refterm>name</refterm>
1015
+ <renderterm>name</renderterm>
1016
+ <xref target='term-name'/>
1017
+ </concept>
1018
+ is a term
664
1019
  </p>
665
1020
  </clause>
666
1021
  </sections>
@@ -668,12 +1023,12 @@ OUTPUT
668
1023
  XML
669
1024
  end
670
1025
 
671
- it 'uses `name` as termref name' do
1026
+ it "uses `name` as termref name" do
672
1027
  expect(convert).to(be_equivalent_to(xmlpp(output)))
673
1028
  end
674
1029
  end
675
1030
 
676
- context 'multiply exising ids in document' do
1031
+ context "multiply exising ids in document" do
677
1032
  let(:input) do
678
1033
  <<~XML
679
1034
  #{ASCIIDOC_BLANK_HDR}
@@ -693,6 +1048,8 @@ OUTPUT
693
1048
 
694
1049
  term:[name] is a term
695
1050
  term:[name2] is a term
1051
+ {{name}} is a term
1052
+ {{name2}} is a term
696
1053
  XML
697
1054
  end
698
1055
  let(:output) do
@@ -716,14 +1073,30 @@ OUTPUT
716
1073
  <clause id='term-name2' inline-header='false' obligation='normative'>
717
1074
  <title>Second</title>
718
1075
  <p id='_'>
719
- <em>name</em>
720
- (
721
- <xref target='term-name-1' />
722
- ) is a term
723
- <em>name2</em>
724
- (
725
- <xref target='term-name2-1' />
726
- ) is a term
1076
+ <concept>
1077
+ <refterm>name</refterm>
1078
+ <renderterm>name</renderterm>
1079
+ <xref target='term-name-1'/>
1080
+ </concept>
1081
+ is a term
1082
+ <concept>
1083
+ <refterm>name2</refterm>
1084
+ <renderterm>name2</renderterm>
1085
+ <xref target='term-name2-1'/>
1086
+ </concept>
1087
+ is a term
1088
+ <concept>
1089
+ <refterm>name</refterm>
1090
+ <renderterm>name</renderterm>
1091
+ <xref target='term-name-1'/>
1092
+ </concept>
1093
+ is a term
1094
+ <concept>
1095
+ <refterm>name2</refterm>
1096
+ <renderterm>name2</renderterm>
1097
+ <xref target='term-name2-1'/>
1098
+ </concept>
1099
+ is a term
727
1100
  </p>
728
1101
  </clause>
729
1102
  </sections>
@@ -731,12 +1104,12 @@ OUTPUT
731
1104
  XML
732
1105
  end
733
1106
 
734
- it 'generates unique ids which do not match existing ids' do
1107
+ it "generates unique ids which do not match existing ids" do
735
1108
  expect(convert).to(be_equivalent_to(xmlpp(output)))
736
1109
  end
737
1110
  end
738
1111
 
739
- context 'when missing actual ref' do
1112
+ context "when missing actual ref" do
740
1113
  let(:input) do
741
1114
  <<~XML
742
1115
  #{ASCIIDOC_BLANK_HDR}
@@ -755,49 +1128,96 @@ OUTPUT
755
1128
  term:[name identity] is a term
756
1129
 
757
1130
  Moreover, term:[missing] is a term
1131
+
1132
+
1133
+ {{name check}} is a term
1134
+
1135
+ {{name identity}} is a term
1136
+
1137
+ Moreover, {{missing}} is a term
758
1138
  XML
759
1139
  end
760
1140
  let(:output) do
761
1141
  <<~XML
762
1142
  #{BLANK_HDR}
763
- <sections>
764
- <terms id='_' obligation='normative'>
765
- <title>Terms and definitions</title>
766
- <p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
767
- <term id='term-name-identity'>
768
- <preferred>name identity</preferred>
769
- </term>
770
- <term id='name-check'>
771
- <preferred>name check</preferred>
772
- <definition>
773
- <p id='_'>paragraph</p>
774
- <p id='_'>
775
- <em>name check</em>
776
- (
777
- <xref target='name-check'/>
778
- ) is a term
779
- </p>
780
- <p id='_'>
781
- <em>name identity</em>
782
- (
783
- <xref target='term-name-identity'/>
784
- ) is a term
785
- </p>
786
- <p id="_">Moreover, (<strong>term “missing” not resolved</strong>) is a term
787
- </p>
788
- </definition>
789
- </term>
790
- </terms>
791
- </sections>
792
- </standard-document>
1143
+ <sections>
1144
+ <terms id='_' obligation='normative'>
1145
+ <title>Terms and definitions</title>
1146
+ <p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
1147
+ <term id='term-name-identity'>
1148
+ <preferred>name identity</preferred>
1149
+ </term>
1150
+ <term id='name-check'>
1151
+ <preferred>name check</preferred>
1152
+ <definition>
1153
+ <p id='_'>paragraph</p>
1154
+ <p id='_'>
1155
+ <concept>
1156
+ <refterm>name check</refterm>
1157
+ <renderterm>name check</renderterm>
1158
+ <xref target='name-check'/>
1159
+ </concept>
1160
+ is a term
1161
+ </p>
1162
+ <p id='_'>
1163
+ <concept>
1164
+ <refterm>name identity</refterm>
1165
+ <renderterm>name identity</renderterm>
1166
+ <xref target='term-name-identity'/>
1167
+ </concept>
1168
+ is a term
1169
+ </p>
1170
+ <p id='_'>
1171
+ Moreover,
1172
+ <concept>
1173
+ <strong>
1174
+ term
1175
+ <tt>missing</tt>
1176
+ not resolved via ID
1177
+ <tt>missing</tt>
1178
+ </strong>
1179
+ </concept>
1180
+ is a term
1181
+ </p>
1182
+ <p id='_'>
1183
+ <concept>
1184
+ <refterm>name check</refterm>
1185
+ <renderterm>name check</renderterm>
1186
+ <xref target='name-check'/>
1187
+ </concept>
1188
+ is a term
1189
+ </p>
1190
+ <p id='_'>
1191
+ <concept>
1192
+ <refterm>name identity</refterm>
1193
+ <renderterm>name identity</renderterm>
1194
+ <xref target='term-name-identity'/>
1195
+ </concept>
1196
+ is a term
1197
+ </p>
1198
+ <p id='_'>
1199
+ Moreover,
1200
+ <concept>
1201
+ <strong>
1202
+ term
1203
+ <tt>missing</tt>
1204
+ not resolved via ID
1205
+ <tt>missing</tt>
1206
+ </strong>
1207
+ </concept>
1208
+ is a term
1209
+ </p>
1210
+ </definition>
1211
+ </term>
1212
+ </terms>
1213
+ </sections>
1214
+ </standard-document>
793
1215
  XML
794
1216
  end
795
1217
 
796
- it 'generates unique ids which do not match existing ids' do
1218
+ it "generates unique ids which do not match existing ids" do
797
1219
  expect(convert).to(be_equivalent_to(xmlpp(output)))
798
1220
  end
799
1221
  end
800
-
801
- end
802
-
1222
+ end
803
1223
  end