metanorma-iso 1.7.1 → 1.7.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +0 -4
- data/lib/asciidoctor/iso/base.rb +12 -12
- data/lib/asciidoctor/iso/cleanup.rb +1 -1
- data/lib/asciidoctor/iso/isodoc.rng +19 -1
- data/lib/asciidoctor/iso/isostandard-amd.rng +3 -0
- data/lib/asciidoctor/iso/isostandard.rng +6 -0
- data/lib/metanorma/iso/version.rb +1 -1
- data/spec/asciidoctor-iso/amd_spec.rb +575 -573
- data/spec/asciidoctor-iso/base_spec.rb +445 -454
- data/spec/asciidoctor-iso/blocks_spec.rb +333 -288
- data/spec/asciidoctor-iso/cleanup_spec.rb +813 -704
- data/spec/asciidoctor-iso/inline_spec.rb +116 -91
- data/spec/asciidoctor-iso/lists_spec.rb +128 -121
- data/spec/asciidoctor-iso/refs_spec.rb +308 -250
- data/spec/asciidoctor-iso/section_spec.rb +273 -242
- data/spec/asciidoctor-iso/table_spec.rb +258 -242
- data/spec/asciidoctor-iso/validate_spec.rb +1099 -1165
- data/spec/isodoc/amd_spec.rb +967 -946
- data/spec/isodoc/blocks_spec.rb +530 -507
- data/spec/isodoc/i18n_spec.rb +953 -911
- data/spec/isodoc/inline_spec.rb +355 -293
- data/spec/isodoc/iso_spec.rb +338 -314
- data/spec/isodoc/metadata_spec.rb +392 -382
- data/spec/isodoc/postproc_spec.rb +833 -656
- data/spec/isodoc/ref_spec.rb +374 -331
- data/spec/isodoc/section_spec.rb +608 -525
- data/spec/isodoc/table_spec.rb +472 -411
- data/spec/isodoc/terms_spec.rb +209 -185
- data/spec/isodoc/xref_spec.rb +1370 -1236
- data/spec/metanorma/processor_spec.rb +28 -26
- data/spec/spec_helper.rb +176 -193
- metadata +2 -4
- data/.rubocop.ribose.yml +0 -66
- data/spec/assets/xref_error.adoc +0 -7
@@ -2,7 +2,7 @@ require "spec_helper"
|
|
2
2
|
|
3
3
|
RSpec.describe Asciidoctor::ISO do
|
4
4
|
it "processes inline_quoted formatting" do
|
5
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
5
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
6
6
|
#{ASCIIDOC_BLANK_HDR}
|
7
7
|
_emphasis_
|
8
8
|
*strong*
|
@@ -19,35 +19,55 @@ RSpec.describe Asciidoctor::ISO do
|
|
19
19
|
[strike]#strike#
|
20
20
|
[smallcap]#smallcap#
|
21
21
|
INPUT
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
<
|
35
|
-
|
36
|
-
</mrow>
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
22
|
+
#{BLANK_HDR}
|
23
|
+
<sections>
|
24
|
+
<em>emphasis</em>
|
25
|
+
<strong>strong</strong>
|
26
|
+
<tt>monospace</tt>“double quote”
|
27
|
+
‘single quote’
|
28
|
+
super
|
29
|
+
<sup>script</sup>
|
30
|
+
sub
|
31
|
+
<sub>script</sub>
|
32
|
+
<stem type="MathML">
|
33
|
+
<math xmlns="http://www.w3.org/1998/Math/MathML">
|
34
|
+
<msub>
|
35
|
+
<mrow>
|
36
|
+
<mi>a</mi></mrow>
|
37
|
+
<mrow>
|
38
|
+
<mn>90</mn>
|
39
|
+
</mrow>
|
40
|
+
</msub>
|
41
|
+
</math>
|
42
|
+
</stem>
|
43
|
+
<stem type="MathML">
|
44
|
+
<math xmlns="http://www.w3.org/1998/Math/MathML">
|
45
|
+
<msub>
|
46
|
+
<mrow>
|
47
|
+
<mrow>
|
48
|
+
<mi mathvariant="bold-italic">F</mi>
|
49
|
+
</mrow>
|
50
|
+
</mrow>
|
51
|
+
<mrow>
|
52
|
+
<mrow>
|
53
|
+
<mi mathvariant="bold-italic">Α</mi>
|
54
|
+
</mrow>
|
55
|
+
</mrow>
|
56
|
+
</msub>
|
57
|
+
</math>
|
58
|
+
</stem>
|
59
|
+
<admitted>alt</admitted>
|
60
|
+
<deprecates>deprecated</deprecates>
|
61
|
+
<domain>domain</domain>
|
62
|
+
<strike>strike</strike>
|
63
|
+
<smallcap>smallcap</smallcap>
|
64
|
+
</sections>
|
65
|
+
</iso-standard>
|
46
66
|
OUTPUT
|
47
67
|
end
|
48
68
|
|
49
69
|
it "processes breaks" do
|
50
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
70
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
51
71
|
#{ASCIIDOC_BLANK_HDR}
|
52
72
|
Line break +
|
53
73
|
line break
|
@@ -56,47 +76,51 @@ RSpec.describe Asciidoctor::ISO do
|
|
56
76
|
|
57
77
|
<<<
|
58
78
|
INPUT
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
79
|
+
#{BLANK_HDR}
|
80
|
+
<sections>
|
81
|
+
<p id="_">Line break
|
82
|
+
<br/>
|
83
|
+
line break</p>
|
84
|
+
<hr/>
|
85
|
+
<pagebreak/>
|
86
|
+
</sections>
|
87
|
+
</iso-standard>
|
65
88
|
OUTPUT
|
66
89
|
end
|
67
90
|
|
68
91
|
it "processes links" do
|
69
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
92
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
70
93
|
#{ASCIIDOC_BLANK_HDR}
|
71
94
|
mailto:fred@example.com
|
72
95
|
http://example.com[]
|
73
96
|
http://example.com[Link]
|
74
97
|
INPUT
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
98
|
+
#{BLANK_HDR}
|
99
|
+
<sections>
|
100
|
+
<p id="_">mailto:fred@example.com
|
101
|
+
|
102
|
+
<link target="http://example.com"/>
|
103
|
+
<link target="http://example.com">Link</link></p>
|
104
|
+
</sections>
|
105
|
+
</iso-standard>
|
82
106
|
OUTPUT
|
83
107
|
end
|
84
108
|
|
85
|
-
|
86
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
109
|
+
it "processes bookmarks" do
|
110
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
87
111
|
#{ASCIIDOC_BLANK_HDR}
|
88
112
|
Text [[bookmark]] Text
|
89
113
|
INPUT
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
114
|
+
#{BLANK_HDR}
|
115
|
+
<sections>
|
116
|
+
<p id="_">Text <bookmark id="bookmark"/> Text</p>
|
117
|
+
</sections>
|
118
|
+
</iso-standard>
|
95
119
|
OUTPUT
|
96
|
-
|
120
|
+
end
|
97
121
|
|
98
|
-
|
99
|
-
|
122
|
+
it "processes crossreferences" do
|
123
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
100
124
|
#{ASCIIDOC_BLANK_HDR}
|
101
125
|
[[reference]]
|
102
126
|
== Section
|
@@ -106,22 +130,22 @@ RSpec.describe Asciidoctor::ISO do
|
|
106
130
|
Inline Reference with Text to <<reference,text>>
|
107
131
|
Footnoted Reference with Text to <<reference,fn: text>>
|
108
132
|
INPUT
|
109
|
-
|
133
|
+
#{BLANK_HDR}
|
110
134
|
<sections>
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
135
|
+
<clause id="reference" inline-header="false" obligation="normative">
|
136
|
+
<title>Section</title>
|
137
|
+
<p id="_">Inline Reference to <xref target="reference"/>
|
138
|
+
Footnoted Reference to <xref target="reference"/>
|
139
|
+
Inline Reference with Text to <xref target="reference">text</xref>
|
140
|
+
Footnoted Reference with Text to <xref target="reference">text</xref></p>
|
141
|
+
</clause>
|
142
|
+
</sections>
|
143
|
+
</iso-standard>
|
144
|
+
OUTPUT
|
145
|
+
end
|
122
146
|
|
123
|
-
|
124
|
-
|
147
|
+
it "processes bibliographic anchors" do
|
148
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
125
149
|
#{ASCIIDOC_BLANK_HDR}
|
126
150
|
[bibliography]
|
127
151
|
== Normative References
|
@@ -130,41 +154,42 @@ RSpec.describe Asciidoctor::ISO do
|
|
130
154
|
* [[[ISO713]]] Reference
|
131
155
|
|
132
156
|
INPUT
|
133
|
-
|
134
|
-
|
157
|
+
#{BLANK_HDR}
|
158
|
+
<sections>
|
135
159
|
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
160
|
+
</sections>
|
161
|
+
<bibliography>
|
162
|
+
<references id="_" normative="true" obligation="informative">
|
163
|
+
<title>Normative references</title>
|
164
|
+
<p id="_">The following documents are referred to in the text in such a way that some or all of their content constitutes requirements of this document. For dated references, only the edition cited applies. For undated references, the latest edition of the referenced document (including any amendments) applies.</p>
|
165
|
+
<bibitem id="ISO712">
|
166
|
+
<formattedref format="application/x-isodoc+xml">Reference</formattedref>
|
167
|
+
<docidentifier>x</docidentifier>
|
168
|
+
</bibitem>
|
169
|
+
<bibitem id="ISO713">
|
170
|
+
<formattedref format="application/x-isodoc+xml">Reference</formattedref>
|
171
|
+
<docidentifier>ISO713</docidentifier>
|
172
|
+
<docnumber>713</docnumber>
|
173
|
+
</bibitem>
|
174
|
+
</references>
|
175
|
+
</bibliography>
|
176
|
+
</iso-standard>
|
151
177
|
OUTPUT
|
152
178
|
end
|
153
179
|
|
154
180
|
it "processes footnotes" do
|
155
|
-
|
181
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
156
182
|
#{ASCIIDOC_BLANK_HDR}
|
157
183
|
Hello!footnote:[Footnote text]
|
158
184
|
INPUT
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
185
|
+
#{BLANK_HDR}
|
186
|
+
<sections>
|
187
|
+
<p id="_">Hello!
|
188
|
+
<fn reference="1">
|
189
|
+
<p id="_">Footnote text</p></fn>
|
190
|
+
</p>
|
191
|
+
</sections>
|
192
|
+
</iso-standard>
|
166
193
|
OUTPUT
|
167
194
|
end
|
168
|
-
|
169
|
-
|
170
195
|
end
|
@@ -2,7 +2,7 @@ require "spec_helper"
|
|
2
2
|
|
3
3
|
RSpec.describe Asciidoctor::ISO do
|
4
4
|
it "processes simple lists" do
|
5
|
-
output = Asciidoctor.convert(<<~"INPUT",
|
5
|
+
output = Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
6
6
|
#{ASCIIDOC_BLANK_HDR}
|
7
7
|
* List 1
|
8
8
|
* List 2
|
@@ -17,47 +17,47 @@ RSpec.describe Asciidoctor::ISO do
|
|
17
17
|
|
18
18
|
INPUT
|
19
19
|
expect(xmlpp(strip_guid(output))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
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
|
-
|
20
|
+
#{BLANK_HDR}
|
21
|
+
<sections>
|
22
|
+
<ul id="_">
|
23
|
+
<li>
|
24
|
+
<p id="_">List 1</p>
|
25
|
+
</li>
|
26
|
+
<li>
|
27
|
+
<p id="_">List 2</p>
|
28
|
+
</li>
|
29
|
+
<li>
|
30
|
+
<p id="_">List 3</p>
|
31
|
+
<ol id="_">
|
32
|
+
<li>
|
33
|
+
<p id="_">List A</p>
|
34
|
+
</li>
|
35
|
+
<li>
|
36
|
+
<p id="_">List B</p>
|
37
|
+
</li>
|
38
|
+
<li>
|
39
|
+
<p id="_">List C</p>
|
40
|
+
<dl id="_">
|
41
|
+
<dt>List D</dt>
|
42
|
+
<dd>
|
43
|
+
<p id="_">List E</p>
|
44
|
+
</dd>
|
45
|
+
<dt>List F</dt>
|
46
|
+
<dd>
|
47
|
+
<p id="_">List G</p>
|
48
|
+
</dd>
|
49
|
+
</dl>
|
50
|
+
</li>
|
51
|
+
</ol>
|
52
|
+
</li>
|
53
|
+
</ul>
|
54
|
+
</sections>
|
55
|
+
</iso-standard>
|
56
56
|
OUTPUT
|
57
57
|
end
|
58
58
|
|
59
|
-
|
60
|
-
output = Asciidoctor.convert(<<~"INPUT",
|
59
|
+
it "processes complex lists" do
|
60
|
+
output = Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
61
61
|
#{ASCIIDOC_BLANK_HDR}
|
62
62
|
[[id]]
|
63
63
|
* First
|
@@ -99,92 +99,99 @@ RSpec.describe Asciidoctor::ISO do
|
|
99
99
|
|
100
100
|
INPUT
|
101
101
|
expect(xmlpp(strip_guid(output))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
102
|
+
#{BLANK_HDR}
|
103
|
+
<sections>
|
104
|
+
<ul id="id">
|
105
|
+
<li>
|
106
|
+
<p id="_">First</p>
|
107
|
+
</li>
|
108
|
+
<li>
|
109
|
+
<p id="_">Second</p>
|
110
|
+
<p id="_">entry1</p>
|
111
|
+
<p id="_">entry2</p>
|
112
|
+
</li>
|
113
|
+
</ul>
|
114
|
+
<ol id="id1">
|
115
|
+
<li>
|
116
|
+
<p id="_">First</p>
|
117
|
+
</li>
|
118
|
+
<li>
|
119
|
+
<p id="_">Second</p>
|
120
|
+
<ol id="_">
|
121
|
+
<li>
|
122
|
+
<p id="_">Third</p>
|
123
|
+
</li>
|
124
|
+
<li>
|
125
|
+
<p id="_">Fourth</p>
|
126
|
+
</li>
|
127
|
+
</ol>
|
128
|
+
</li>
|
129
|
+
<li>
|
130
|
+
<p id="_">Fifth</p>
|
131
|
+
</li>
|
132
|
+
<li>
|
133
|
+
<p id="_">Sixth</p>
|
134
|
+
</li>
|
135
|
+
</ol>
|
136
|
+
<ol id="_">
|
137
|
+
<li>
|
138
|
+
<p id="_">A</p>
|
139
|
+
</li>
|
140
|
+
<li>
|
141
|
+
<p id="_">B</p>
|
142
|
+
<ol id="_">
|
143
|
+
<li>
|
144
|
+
<p id="_">C</p>
|
145
|
+
</li>
|
146
|
+
<li>
|
147
|
+
<p id="_">D</p>
|
148
|
+
<ol id="_">
|
149
|
+
<li>
|
150
|
+
<p id="_">E</p>
|
151
|
+
</li>
|
152
|
+
<li>
|
153
|
+
<p id="_">F</p>
|
154
|
+
<dl id="_">
|
155
|
+
<dt>Notes1</dt>
|
156
|
+
<dd/>
|
157
|
+
<dt>Notes</dt>
|
158
|
+
<dd>
|
159
|
+
<p id="_">Note 1.</p>
|
160
|
+
<p id="_">Note 2.</p>
|
161
|
+
<p id="_">Note 3.</p>
|
162
|
+
</dd>
|
163
|
+
</dl>
|
164
|
+
</li>
|
165
|
+
</ol>
|
166
|
+
</li>
|
167
|
+
</ol>
|
168
|
+
</li>
|
169
|
+
</ol>
|
170
|
+
</sections>
|
171
|
+
</iso-standard>
|
172
|
+
OUTPUT
|
173
|
+
end
|
166
174
|
|
167
|
-
|
168
|
-
|
175
|
+
it "anchors lists and list items" do
|
176
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
169
177
|
#{ASCIIDOC_BLANK_HDR}
|
170
178
|
[[id1]]
|
171
179
|
* [[id2]] List item
|
172
180
|
* Hello [[id3]] List item
|
173
181
|
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
182
|
+
INPUT
|
183
|
+
#{BLANK_HDR}
|
184
|
+
<sections>
|
185
|
+
<ul id="id1">
|
186
|
+
<li id="id2">
|
187
|
+
<p id="_">List item</p>
|
188
|
+
</li>
|
189
|
+
<li>
|
190
|
+
<p id="_">Hello <bookmark id="id3"/> List item</p>
|
191
|
+
</li>
|
192
|
+
</ul>
|
193
|
+
</sections>
|
194
|
+
</iso-standard>
|
195
|
+
OUTPUT
|
196
|
+
end
|
190
197
|
end
|