metanorma-standoc 1.9.2 → 1.10.1

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 (66) 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 -6
  5. data/lib/asciidoctor/standoc/base.rb +3 -1
  6. data/lib/asciidoctor/standoc/biblio.rng +1 -0
  7. data/lib/asciidoctor/standoc/blocks.rb +1 -1
  8. data/lib/asciidoctor/standoc/cleanup.rb +34 -15
  9. data/lib/asciidoctor/standoc/cleanup_block.rb +0 -1
  10. data/lib/asciidoctor/standoc/cleanup_boilerplate.rb +2 -2
  11. data/lib/asciidoctor/standoc/cleanup_footnotes.rb +0 -1
  12. data/lib/asciidoctor/standoc/cleanup_inline.rb +117 -77
  13. data/lib/asciidoctor/standoc/cleanup_maths.rb +0 -1
  14. data/lib/asciidoctor/standoc/cleanup_ref.rb +7 -0
  15. data/lib/asciidoctor/standoc/cleanup_section.rb +73 -137
  16. data/lib/asciidoctor/standoc/cleanup_section_names.rb +75 -0
  17. data/lib/asciidoctor/standoc/cleanup_terms.rb +19 -18
  18. data/lib/asciidoctor/standoc/converter.rb +1 -0
  19. data/lib/asciidoctor/standoc/front.rb +1 -2
  20. data/lib/asciidoctor/standoc/front_contributor.rb +66 -42
  21. data/lib/asciidoctor/standoc/inline.rb +45 -34
  22. data/lib/asciidoctor/standoc/isodoc.rng +66 -10
  23. data/lib/asciidoctor/standoc/macros.rb +7 -5
  24. data/lib/asciidoctor/standoc/macros_plantuml.rb +21 -23
  25. data/lib/asciidoctor/standoc/macros_terms.rb +60 -23
  26. data/lib/asciidoctor/standoc/section.rb +19 -12
  27. data/lib/asciidoctor/standoc/term_lookup_cleanup.rb +87 -33
  28. data/lib/asciidoctor/standoc/terms.rb +1 -1
  29. data/lib/asciidoctor/standoc/utils.rb +0 -1
  30. data/lib/asciidoctor/standoc/validate.rb +22 -8
  31. data/lib/isodoc/html/html_titlepage.html +81 -0
  32. data/lib/isodoc/html/htmlstyle.css +983 -0
  33. data/lib/isodoc/html/htmlstyle.scss +714 -0
  34. data/lib/isodoc/html/scripts.html +71 -0
  35. data/lib/metanorma/standoc/processor.rb +16 -7
  36. data/lib/metanorma/standoc/version.rb +1 -1
  37. data/metanorma-standoc.gemspec +3 -3
  38. data/spec/asciidoctor/base_spec.rb +697 -557
  39. data/spec/asciidoctor/blocks_spec.rb +6 -8
  40. data/spec/asciidoctor/cleanup_sections_spec.rb +14 -14
  41. data/spec/asciidoctor/cleanup_spec.rb +899 -688
  42. data/spec/asciidoctor/inline_spec.rb +62 -14
  43. data/spec/asciidoctor/isobib_cache_spec.rb +4 -6
  44. data/spec/asciidoctor/lists_spec.rb +149 -137
  45. data/spec/asciidoctor/macros_json2text_spec.rb +1 -1
  46. data/spec/asciidoctor/macros_plantuml_spec.rb +8 -8
  47. data/spec/asciidoctor/macros_spec.rb +646 -169
  48. data/spec/asciidoctor/refs_dl_spec.rb +4 -4
  49. data/spec/asciidoctor/refs_spec.rb +1527 -1532
  50. data/spec/asciidoctor/section_spec.rb +58 -22
  51. data/spec/asciidoctor/table_spec.rb +6 -6
  52. data/spec/asciidoctor/validate_spec.rb +352 -304
  53. data/spec/spec_helper.rb +2 -0
  54. data/spec/vcr_cassettes/dated_iso_ref_joint_iso_iec.yml +49 -49
  55. data/spec/vcr_cassettes/isobib_get_123.yml +12 -12
  56. data/spec/vcr_cassettes/isobib_get_123_1.yml +27 -27
  57. data/spec/vcr_cassettes/isobib_get_123_1_fr.yml +35 -35
  58. data/spec/vcr_cassettes/isobib_get_123_2001.yml +14 -14
  59. data/spec/vcr_cassettes/isobib_get_124.yml +14 -14
  60. data/spec/vcr_cassettes/rfcbib_get_rfc8341.yml +14 -14
  61. data/spec/vcr_cassettes/separates_iev_citations_by_top_level_clause.yml +44 -44
  62. metadata +12 -11
  63. data/lib/liquid/custom_blocks/key_iterator.rb +0 -21
  64. data/lib/liquid/custom_blocks/with_json_nested_context.rb +0 -18
  65. data/lib/liquid/custom_blocks/with_yaml_nested_context.rb +0 -19
  66. data/lib/liquid/custom_filters/values.rb +0 -7
@@ -2,13 +2,14 @@ require "spec_helper"
2
2
 
3
3
  RSpec.describe Asciidoctor::Standoc do
4
4
  it "handles spacing around markup" do
5
- expect((strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to (<<~"OUTPUT")
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
11
  INPUT
12
+ output = <<~OUTPUT
12
13
  <?xml version="1.0" encoding="UTF-8"?>
13
14
  <standard-document xmlns="https://www.metanorma.org/ns/standoc" type="semantic" version="#{Metanorma::Standoc::VERSION}">
14
15
  <bibdata type="standard">
@@ -33,10 +34,12 @@ RSpec.describe Asciidoctor::Standoc do
33
34
  </sections>
34
35
  </standard-document>
35
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
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
42
+ input = <<~INPUT
40
43
  #{DUMBQUOTE_BLANK_HDR}
41
44
  _Physical noise
42
45
  sources_
@@ -57,6 +60,7 @@ RSpec.describe Asciidoctor::Standoc do
57
60
  [smallcap]#smallcap#
58
61
  [keyword]#keyword#
59
62
  INPUT
63
+ output = <<~OUTPUT
60
64
  #{BLANK_HDR}
61
65
  <sections>
62
66
  <em>Physical noise sources</em>
@@ -79,14 +83,17 @@ RSpec.describe Asciidoctor::Standoc do
79
83
  </sections>
80
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
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
91
+ input = <<~INPUT
86
92
  #{DUMBQUOTE_BLANK_HDR}
87
93
 
88
94
  stem:[n < 1 " for all text "]
89
95
  INPUT
96
+ output = <<~OUTPUT
90
97
  #{BLANK_HDR}
91
98
  <sections>
92
99
  <p id='_'>
@@ -102,16 +109,19 @@ RSpec.describe Asciidoctor::Standoc do
102
109
  </sections>
103
110
  </standard-document>
104
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
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
117
+ input = <<~INPUT
109
118
  #{DUMBQUOTE_BLANK_HDR}
110
119
 
111
120
  stem:[n < 1] +
112
121
  latexmath:[n < 1]
113
122
  stem:["&#x200c;"^199 "Hg"^+]
114
123
  INPUT
124
+ output = <<~OUTPUT
115
125
  #{BLANK_HDR}
116
126
  <sections>
117
127
  <p id="_">
@@ -141,16 +151,19 @@ RSpec.describe Asciidoctor::Standoc do
141
151
  </sections>
142
152
  </standard-document>
143
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
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
159
+ input = <<~INPUT
148
160
  #{DUMBQUOTE_BLANK_HDR}
149
161
 
150
162
  stem:[n < 1]
151
163
  latexmath:[n < 1]
152
164
  stem:["&#x200c;"^199 "Hg"^+]
153
165
  INPUT
166
+ output = <<~OUTPUT
154
167
  #{BLANK_HDR}
155
168
  <sections>
156
169
  <p id="_">
@@ -180,16 +193,19 @@ RSpec.describe Asciidoctor::Standoc do
180
193
  </sections>
181
194
  </standard-document>
182
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
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
201
+ input = <<~INPUT
187
202
  #{ASCIIDOC_BLANK_HDR}
188
203
 
189
204
  stem:[n < 1]
190
205
  latexmath:[n < 1]
191
206
  stem:["&#x200c;"^199 "Hg"^+]
192
207
  INPUT
208
+ output = <<~OUTPUT
193
209
  #{BLANK_HDR}
194
210
  <sections>
195
211
  <p id="_">
@@ -219,23 +235,28 @@ RSpec.describe Asciidoctor::Standoc do
219
235
  </sections>
220
236
  </standard-document>
221
237
  OUTPUT
238
+ expect((strip_guid(Asciidoctor.convert(input, *OPTIONS))))
239
+ .to be_equivalent_to(output)
222
240
  end
223
241
 
224
242
  it "generates desired smart quotes for 'dd'" do
225
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
243
+ input = <<~INPUT
226
244
  #{ASCIIDOC_BLANK_HDR}
227
245
  '99'.
228
246
 
229
247
  INPUT
248
+ output = <<~OUTPUT
230
249
  #{BLANK_HDR}
231
250
  <sections><p id="_">‘99’.</p>
232
251
  </sections>
233
252
  </standard-document>
234
253
  OUTPUT
254
+ expect((strip_guid(Asciidoctor.convert(input, *OPTIONS))))
255
+ .to be_equivalent_to(output)
235
256
  end
236
257
 
237
258
  it "processes breaks" do
238
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
259
+ input = <<~INPUT
239
260
  #{ASCIIDOC_BLANK_HDR}
240
261
  Line break +
241
262
  line break
@@ -250,6 +271,7 @@ RSpec.describe Asciidoctor::Standoc do
250
271
  [%portrait]
251
272
  <<<
252
273
  INPUT
274
+ output = <<~OUTPUT
253
275
  #{BLANK_HDR}
254
276
  <sections><p id="_">Line break<br/>
255
277
  line break</p>
@@ -260,17 +282,23 @@ RSpec.describe Asciidoctor::Standoc do
260
282
  </sections>
261
283
  </standard-document>
262
284
  OUTPUT
285
+ expect((strip_guid(Asciidoctor.convert(input, *OPTIONS))))
286
+ .to be_equivalent_to(output)
263
287
  end
264
288
 
265
289
  it "processes links" do
266
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
290
+ input = <<~INPUT
267
291
  #{ASCIIDOC_BLANK_HDR}
268
292
  mailto:fred@example.com
269
293
  http://example.com[]
270
294
  http://example.com[Link]
271
295
  http://example.com[Link,title="tip"]
272
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]
273
300
  INPUT
301
+ output = <<~OUTPUT
274
302
  #{BLANK_HDR}
275
303
  <sections>
276
304
  <p id="_">mailto:fred@example.com
@@ -278,27 +306,35 @@ RSpec.describe Asciidoctor::Standoc do
278
306
  <link target="http://example.com">Link</link>
279
307
  <link target="http://example.com" alt="tip">Link</link>
280
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>
281
312
  </p>
282
313
  </sections>
283
314
  </standard-document>
284
315
  OUTPUT
316
+ expect((strip_guid(Asciidoctor.convert(input, *OPTIONS))))
317
+ .to be_equivalent_to(output)
285
318
  end
286
319
 
287
320
  it "processes bookmarks" do
288
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
321
+ input = <<~INPUT
289
322
  #{ASCIIDOC_BLANK_HDR}
290
323
  Text [[bookmark]] Text
291
324
  INPUT
325
+ output = <<~OUTPUT
292
326
  #{BLANK_HDR}
293
327
  <sections>
294
328
  <p id="_">Text <bookmark id="bookmark"/> Text</p>
295
329
  </sections>
296
330
  </standard-document>
297
331
  OUTPUT
332
+ expect((strip_guid(Asciidoctor.convert(input, *OPTIONS))))
333
+ .to be_equivalent_to(output)
298
334
  end
299
335
 
300
336
  it "processes crossreferences" do
301
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
337
+ input = <<~INPUT
302
338
  #{ASCIIDOC_BLANK_HDR}
303
339
  [[reference]]
304
340
  == Section
@@ -318,6 +354,7 @@ RSpec.describe Asciidoctor::Standoc do
318
354
  Lowercase Footnoted Reference to <<reference,droploc%capital%fn>>
319
355
  Lowercase Footnoted Reference to <<reference,droploc%capital%text>>
320
356
  INPUT
357
+ output = <<~OUTPUT
321
358
  #{BLANK_HDR}
322
359
  <sections>
323
360
  <clause id="reference" inline-header="false" obligation="normative">
@@ -348,10 +385,12 @@ RSpec.describe Asciidoctor::Standoc do
348
385
  </sections>
349
386
  </standard-document>
350
387
  OUTPUT
388
+ expect((strip_guid(Asciidoctor.convert(input, *OPTIONS))))
389
+ .to be_equivalent_to(output)
351
390
  end
352
391
 
353
392
  it "processes bibliographic anchors" do
354
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
393
+ input = <<~INPUT
355
394
  #{ASCIIDOC_BLANK_HDR}
356
395
  [bibliography]
357
396
  == Normative References
@@ -360,6 +399,7 @@ RSpec.describe Asciidoctor::Standoc do
360
399
  * [[[ISO713]]] Reference
361
400
 
362
401
  INPUT
402
+ output = <<~OUTPUT
363
403
  #{BLANK_HDR}
364
404
  <sections>
365
405
 
@@ -379,10 +419,12 @@ RSpec.describe Asciidoctor::Standoc do
379
419
  </bibliography>
380
420
  </standard-document>
381
421
  OUTPUT
422
+ expect((strip_guid(Asciidoctor.convert(input, *OPTIONS))))
423
+ .to be_equivalent_to(output)
382
424
  end
383
425
 
384
426
  it "processes footnotes" do
385
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
427
+ input = <<~INPUT
386
428
  #{ASCIIDOC_BLANK_HDR}
387
429
  Hello!footnote:[Footnote text]
388
430
 
@@ -392,6 +434,7 @@ RSpec.describe Asciidoctor::Standoc do
392
434
 
393
435
  Repetition.footnote:abc[]
394
436
  INPUT
437
+ output = <<~OUTPUT
395
438
  #{BLANK_HDR}
396
439
  <preface><foreword id="_" obligation="informative">
397
440
  <title>Foreword</title>
@@ -418,18 +461,23 @@ RSpec.describe Asciidoctor::Standoc do
418
461
  </clause></sections>
419
462
  </standard-document>
420
463
  OUTPUT
464
+ expect((strip_guid(Asciidoctor.convert(input, *OPTIONS))))
465
+ .to be_equivalent_to(output)
421
466
  end
422
467
 
423
468
  it "processes index terms" do
424
- expect((strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to (<<~"OUTPUT")
469
+ input = <<~INPUT
425
470
  #{ASCIIDOC_BLANK_HDR}
426
471
  ((See)) Index ((_term_)) and(((A~B~, stem:[alpha], &#x2c80;))).
427
472
  INPUT
473
+ output = <<~OUTPUT
428
474
  #{BLANK_HDR}
429
475
  <sections>
430
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>
431
477
  </sections>
432
478
  </standard-document>
433
479
  OUTPUT
480
+ expect((strip_guid(Asciidoctor.convert(input, *OPTIONS))))
481
+ .to be_equivalent_to(output)
434
482
  end
435
483
  end
@@ -2,8 +2,6 @@ require "spec_helper"
2
2
  require "relaton_iso"
3
3
  require "fileutils"
4
4
 
5
- OPTIONS = [backend: :standoc, header_footer: true].freeze
6
-
7
5
  IETF_123_SHORT = <<~XML.freeze
8
6
  <bibitem type="standard" id="IETF123">
9
7
  <title format="text/plain" language="en" script="Latn">Rubber latex -- Sampling</title>
@@ -127,7 +125,7 @@ ISO_123_UNDATED = <<~XML.freeze
127
125
  <script>Latn</script>
128
126
  <status>
129
127
  <stage>90</stage>
130
- <substage>20</substage>
128
+ <substage>93</substage>
131
129
  </status>
132
130
  <copyright>
133
131
  <from>2001</from>
@@ -168,7 +166,7 @@ ISO_123_UNDATED = <<~XML.freeze
168
166
  <script>Latn</script>
169
167
  <status>
170
168
  <stage>90</stage>
171
- <substage>20</substage>
169
+ <substage>93</substage>
172
170
  </status>
173
171
  <copyright>
174
172
  <from>2001</from>
@@ -211,7 +209,7 @@ ISO_123_DATED = <<~XML.freeze
211
209
  <uri type="obp">https://www.iso.org/obp/ui/#!iso:std:23281:en</uri>
212
210
  <uri type="rss">https://www.iso.org/contents/data/standard/02/32/23281.detail.rss</uri>
213
211
  <docidentifier type="ISO">ISO 123:2001</docidentifier>
214
- <docidentifier type='URN'>urn:iso:std:iso:123:stage-90.20:ed-3:en</docidentifier>
212
+ <docidentifier type='URN'>urn:iso:std:iso:123:stage-90.93:ed-3:en</docidentifier>
215
213
  <docnumber>123</docnumber>
216
214
  <date type="published">
217
215
  <on>2001-05</on>
@@ -236,7 +234,7 @@ ISO_123_DATED = <<~XML.freeze
236
234
  </abstract>
237
235
  <status>
238
236
  <stage>90</stage>
239
- <substage>20</substage>
237
+ <substage>93</substage>
240
238
  </status>
241
239
  <copyright>
242
240
  <from>2001</from>
@@ -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