metanorma-standoc 1.9.4 → 1.10.3
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 +1 -1
- data/.rubocop.yml +1 -1
- data/lib/asciidoctor/standoc/base.rb +0 -1
- data/lib/asciidoctor/standoc/blocks.rb +1 -1
- data/lib/asciidoctor/standoc/cleanup.rb +61 -2
- data/lib/asciidoctor/standoc/cleanup_block.rb +0 -1
- data/lib/asciidoctor/standoc/cleanup_boilerplate.rb +2 -2
- data/lib/asciidoctor/standoc/cleanup_footnotes.rb +0 -1
- data/lib/asciidoctor/standoc/cleanup_inline.rb +117 -77
- data/lib/asciidoctor/standoc/cleanup_maths.rb +0 -1
- data/lib/asciidoctor/standoc/cleanup_ref.rb +7 -0
- data/lib/asciidoctor/standoc/cleanup_section.rb +0 -1
- data/lib/asciidoctor/standoc/cleanup_terms.rb +19 -18
- data/lib/asciidoctor/standoc/converter.rb +3 -0
- data/lib/asciidoctor/standoc/datamodel/diagram_preprocessor.rb +22 -21
- data/lib/asciidoctor/standoc/front.rb +0 -1
- data/lib/asciidoctor/standoc/front_contributor.rb +0 -1
- data/lib/asciidoctor/standoc/inline.rb +20 -17
- data/lib/asciidoctor/standoc/isodoc.rng +56 -8
- data/lib/asciidoctor/standoc/macros.rb +25 -5
- data/lib/asciidoctor/standoc/macros_plantuml.rb +21 -23
- data/lib/asciidoctor/standoc/macros_terms.rb +60 -23
- data/lib/asciidoctor/standoc/ref.rb +60 -56
- data/lib/asciidoctor/standoc/section.rb +19 -12
- data/lib/asciidoctor/standoc/term_lookup_cleanup.rb +69 -30
- data/lib/asciidoctor/standoc/terms.rb +1 -1
- data/lib/asciidoctor/standoc/utils.rb +0 -1
- data/lib/asciidoctor/standoc/validate.rb +22 -8
- data/lib/isodoc/html/html_titlepage.html +81 -0
- data/lib/isodoc/html/htmlstyle.css +983 -0
- data/lib/isodoc/html/htmlstyle.scss +714 -0
- data/lib/isodoc/html/scripts.html +71 -0
- data/lib/metanorma/standoc/processor.rb +16 -7
- data/lib/metanorma/standoc/version.rb +1 -1
- data/metanorma-standoc.gemspec +3 -3
- data/spec/asciidoctor/blocks_spec.rb +8 -8
- data/spec/asciidoctor/cleanup_sections_spec.rb +899 -864
- data/spec/asciidoctor/cleanup_spec.rb +85 -20
- data/spec/asciidoctor/isobib_cache_spec.rb +4 -6
- data/spec/asciidoctor/lists_spec.rb +147 -135
- data/spec/asciidoctor/macros_json2text_spec.rb +1 -1
- data/spec/asciidoctor/macros_plantuml_spec.rb +165 -104
- data/spec/asciidoctor/macros_spec.rb +813 -168
- data/spec/asciidoctor/refs_spec.rb +12 -12
- data/spec/asciidoctor/validate_spec.rb +76 -20
- data/spec/support/shared_examples/structured_data_2_text_preprocessor.rb +34 -34
- data/spec/vcr_cassettes/dated_iso_ref_joint_iso_iec.yml +50 -50
- data/spec/vcr_cassettes/isobib_get_123.yml +13 -13
- data/spec/vcr_cassettes/isobib_get_123_1.yml +26 -26
- data/spec/vcr_cassettes/isobib_get_123_1_fr.yml +34 -34
- data/spec/vcr_cassettes/isobib_get_123_2001.yml +14 -14
- data/spec/vcr_cassettes/isobib_get_124.yml +11 -11
- data/spec/vcr_cassettes/rfcbib_get_rfc8341.yml +14 -14
- data/spec/vcr_cassettes/separates_iev_citations_by_top_level_clause.yml +51 -61
- metadata +11 -7
@@ -316,6 +316,40 @@ RSpec.describe Asciidoctor::Standoc do
|
|
316
316
|
.to be_equivalent_to xmlpp(output)
|
317
317
|
end
|
318
318
|
|
319
|
+
it "ignores tags when applying smartquotes" do
|
320
|
+
input = <<~INPUT
|
321
|
+
#{ASCIIDOC_BLANK_HDR}
|
322
|
+
|
323
|
+
"((ppt))",
|
324
|
+
|
325
|
+
"((ppm))", "((ppt))"
|
326
|
+
INPUT
|
327
|
+
output = <<~OUTPUT
|
328
|
+
#{BLANK_HDR}
|
329
|
+
<sections>
|
330
|
+
<p id='_'>
|
331
|
+
“ppt”,
|
332
|
+
<index>
|
333
|
+
<primary>ppt</primary>
|
334
|
+
</index>
|
335
|
+
</p>
|
336
|
+
<p id='_'>
|
337
|
+
“ppm”,
|
338
|
+
<index>
|
339
|
+
<primary>ppm</primary>
|
340
|
+
</index>
|
341
|
+
“ppt”
|
342
|
+
<index>
|
343
|
+
<primary>ppt</primary>
|
344
|
+
</index>
|
345
|
+
</p>
|
346
|
+
</sections>
|
347
|
+
</standard-document>
|
348
|
+
OUTPUT
|
349
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
350
|
+
.to be_equivalent_to xmlpp(output)
|
351
|
+
end
|
352
|
+
|
319
353
|
it "removes empty text elements" do
|
320
354
|
input = <<~INPUT
|
321
355
|
#{ASCIIDOC_BLANK_HDR}
|
@@ -486,7 +520,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
486
520
|
output = <<~OUTPUT
|
487
521
|
#{BLANK_HDR}
|
488
522
|
<sections><formula id="_">
|
489
|
-
<stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>r</mi><mo>=</mo><mn>1</mn><
|
523
|
+
<stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>r</mi><mo>=</mo><mn>1</mn><mo>%</mo><mi>r</mi><mo>=</mo><mn>1</mn><mo>%</mo></math></stem>
|
490
524
|
<note id="_">
|
491
525
|
<p id="_">That formula does not do much</p>
|
492
526
|
</note></formula>
|
@@ -517,7 +551,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
517
551
|
output = <<~OUTPUT
|
518
552
|
#{BLANK_HDR}
|
519
553
|
<sections><formula id="_">
|
520
|
-
<stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>r</mi><mo>=</mo><mn>1</mn><
|
554
|
+
<stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>r</mi><mo>=</mo><mn>1</mn><mo>%</mo><mi>r</mi><mo>=</mo><mn>1</mn><mo>%</mo></math></stem></formula>
|
521
555
|
<note id="_">
|
522
556
|
<p id="_">That formula does not do much</p>
|
523
557
|
</note>
|
@@ -1618,11 +1652,42 @@ RSpec.describe Asciidoctor::Standoc do
|
|
1618
1652
|
</standard-document>
|
1619
1653
|
INPUT
|
1620
1654
|
output = <<~OUTPUT
|
1621
|
-
|
1622
|
-
|
1623
|
-
|
1655
|
+
#{BLANK_HDR}
|
1656
|
+
<sections>
|
1657
|
+
<stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><mfrac><mn>1</mn><mi>r</mi></mfrac></math></stem>
|
1624
1658
|
</sections>
|
1625
|
-
|
1659
|
+
</standard-document>
|
1660
|
+
OUTPUT
|
1661
|
+
expect(Asciidoctor::Standoc::Converter.new(nil, *OPTIONS)
|
1662
|
+
.cleanup(Nokogiri::XML(input)).to_xml)
|
1663
|
+
.to be_equivalent_to xmlpp(output)
|
1664
|
+
end
|
1665
|
+
|
1666
|
+
it "removes nested bibitem IDs" do
|
1667
|
+
input = <<~INPUT
|
1668
|
+
#{BLANK_HDR}
|
1669
|
+
<bibliography>
|
1670
|
+
<references normative="true"><title>Normative</title>
|
1671
|
+
<bibitem id="A">
|
1672
|
+
<relation type="includes">
|
1673
|
+
<bibitem id="B"/>
|
1674
|
+
</relation>
|
1675
|
+
</bibitem>
|
1676
|
+
</bibliography>
|
1677
|
+
</standard-document>
|
1678
|
+
INPUT
|
1679
|
+
output = <<~OUTPUT
|
1680
|
+
#{BLANK_HDR}
|
1681
|
+
<bibliography>
|
1682
|
+
<references normative="true"><title>Normative</title>
|
1683
|
+
<bibitem id="A">
|
1684
|
+
<relation type="includes">
|
1685
|
+
<bibitem id="B"/>
|
1686
|
+
</relation>
|
1687
|
+
</bibitem>
|
1688
|
+
</references>
|
1689
|
+
</bibliography>
|
1690
|
+
</standard-document>
|
1626
1691
|
OUTPUT
|
1627
1692
|
expect(Asciidoctor::Standoc::Converter.new(nil, *OPTIONS)
|
1628
1693
|
.cleanup(Nokogiri::XML(input)).to_xml)
|
@@ -1879,7 +1944,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
1879
1944
|
.to be_equivalent_to xmlpp(output)
|
1880
1945
|
end
|
1881
1946
|
|
1882
|
-
it "sorts symbols lists" do
|
1947
|
+
it "sorts symbols lists #1" do
|
1883
1948
|
input = <<~INPUT
|
1884
1949
|
#{ASCIIDOC_BLANK_HDR}
|
1885
1950
|
|
@@ -1900,11 +1965,11 @@ RSpec.describe Asciidoctor::Standoc do
|
|
1900
1965
|
<definitions id='L' obligation="normative">
|
1901
1966
|
<title>Symbols and abbreviated terms</title>
|
1902
1967
|
<dl id='_'>
|
1903
|
-
<dt>m</dt>
|
1968
|
+
<dt id="symbol-m">m</dt>
|
1904
1969
|
<dd>
|
1905
1970
|
<p id='_'>Definition 7</p>
|
1906
1971
|
</dd>
|
1907
|
-
<dt>
|
1972
|
+
<dt id="symbol-_-n-">
|
1908
1973
|
<stem type='MathML'>
|
1909
1974
|
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
1910
1975
|
<mi>n</mi>
|
@@ -1914,23 +1979,23 @@ RSpec.describe Asciidoctor::Standoc do
|
|
1914
1979
|
<dd>
|
1915
1980
|
<p id='_'>Definition 6</p>
|
1916
1981
|
</dd>
|
1917
|
-
<dt>x</dt>
|
1982
|
+
<dt id="symbol-x">x</dt>
|
1918
1983
|
<dd>
|
1919
1984
|
<p id='_'>Definition 5</p>
|
1920
1985
|
</dd>
|
1921
|
-
<dt>x_m_</dt>
|
1986
|
+
<dt id='symbol-x_m_'>x_m_</dt>
|
1922
1987
|
<dd>
|
1923
1988
|
<p id='_'>Definition 4</p>
|
1924
1989
|
</dd>
|
1925
|
-
<dt>x_1_</dt>
|
1990
|
+
<dt id='symbol-x_1_'>x_1_</dt>
|
1926
1991
|
<dd>
|
1927
1992
|
<p id='_'>Definition 3</p>
|
1928
1993
|
</dd>
|
1929
|
-
<dt>Xa</dt>
|
1994
|
+
<dt id='symbol-xa'>Xa</dt>
|
1930
1995
|
<dd>
|
1931
1996
|
<p id='_'>Definition 2</p>
|
1932
1997
|
</dd>
|
1933
|
-
<dt>α</dt>
|
1998
|
+
<dt id='symbol-α'>α</dt>
|
1934
1999
|
<dd>
|
1935
2000
|
<p id='_'>Definition 1</p>
|
1936
2001
|
</dd>
|
@@ -1943,7 +2008,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
1943
2008
|
.to be_equivalent_to xmlpp(output)
|
1944
2009
|
end
|
1945
2010
|
|
1946
|
-
it "sorts symbols lists" do
|
2011
|
+
it "sorts symbols lists #2" do
|
1947
2012
|
input = <<~INPUT
|
1948
2013
|
#{ASCIIDOC_BLANK_HDR}
|
1949
2014
|
|
@@ -1962,11 +2027,11 @@ RSpec.describe Asciidoctor::Standoc do
|
|
1962
2027
|
<definitions id='L' obligation="normative">
|
1963
2028
|
<title>Symbols and abbreviated terms</title>
|
1964
2029
|
<dl id='_'>
|
1965
|
-
<dt>x</dt>
|
2030
|
+
<dt id='symbol-x'>x</dt>
|
1966
2031
|
<dd>
|
1967
2032
|
<p id='_'>Definition 5</p>
|
1968
2033
|
</dd>
|
1969
|
-
<dt><stem type='MathML'>
|
2034
|
+
<dt id='symbol-_-xm-'><stem type='MathML'>
|
1970
2035
|
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
1971
2036
|
<msub>
|
1972
2037
|
<mrow>
|
@@ -1981,7 +2046,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
1981
2046
|
<dd>
|
1982
2047
|
<p id='_'>Definition 4</p>
|
1983
2048
|
</dd>
|
1984
|
-
<dt><stem type='MathML'>
|
2049
|
+
<dt id='symbol-_-x1-'><stem type='MathML'>
|
1985
2050
|
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
1986
2051
|
<msub>
|
1987
2052
|
<mrow>
|
@@ -1996,11 +2061,11 @@ RSpec.describe Asciidoctor::Standoc do
|
|
1996
2061
|
<dd>
|
1997
2062
|
<p id='_'>Definition 3</p>
|
1998
2063
|
</dd>
|
1999
|
-
<dt>xa</dt>
|
2064
|
+
<dt id='symbol-xa'>xa</dt>
|
2000
2065
|
<dd>
|
2001
2066
|
<p id='_'>Definition 2</p>
|
2002
2067
|
</dd>
|
2003
|
-
<dt>
|
2068
|
+
<dt id='symbol-_-α-'>
|
2004
2069
|
<stem type='MathML'>
|
2005
2070
|
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
2006
2071
|
<mi>α</mi>
|
@@ -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>
|
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>
|
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.
|
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>
|
237
|
+
<substage>93</substage>
|
240
238
|
</status>
|
241
239
|
<copyright>
|
242
240
|
<from>2001</from>
|
@@ -21,55 +21,55 @@ RSpec.describe Asciidoctor::Standoc do
|
|
21
21
|
|
22
22
|
INPUT
|
23
23
|
expect(xmlpp(strip_guid(output))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
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
|
-
|
72
|
+
it "processes complex lists" do
|
73
73
|
output = Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
74
74
|
#{ASCIIDOC_BLANK_HDR}
|
75
75
|
[[id]]
|
@@ -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
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
</
|
186
|
-
</
|
187
|
-
|
188
|
-
|
189
|
-
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
|
-
|
192
|
-
|
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
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
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
|