metanorma-standoc 1.8.7 → 1.9.3
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.
- checksums.yaml +4 -4
- data/.rubocop.yml +0 -2
- data/Gemfile.devel +0 -0
- data/lib/asciidoctor/standoc/base.rb +39 -36
- data/lib/asciidoctor/standoc/biblio.rng +1 -0
- data/lib/asciidoctor/standoc/blocks.rb +25 -9
- data/lib/asciidoctor/standoc/blocks_notes.rb +41 -24
- data/lib/asciidoctor/standoc/cleanup.rb +59 -84
- data/lib/asciidoctor/standoc/cleanup_block.rb +63 -85
- data/lib/asciidoctor/standoc/cleanup_boilerplate.rb +51 -29
- data/lib/asciidoctor/standoc/cleanup_footnotes.rb +1 -0
- data/lib/asciidoctor/standoc/cleanup_image.rb +71 -0
- data/lib/asciidoctor/standoc/cleanup_maths.rb +36 -27
- data/lib/asciidoctor/standoc/cleanup_ref.rb +24 -15
- data/lib/asciidoctor/standoc/cleanup_ref_dl.rb +1 -1
- data/lib/asciidoctor/standoc/cleanup_reqt.rb +47 -0
- data/lib/asciidoctor/standoc/cleanup_section.rb +104 -94
- data/lib/asciidoctor/standoc/converter.rb +10 -3
- data/lib/asciidoctor/standoc/datamodel/plantuml_renderer.rb +67 -66
- data/lib/asciidoctor/standoc/front.rb +35 -18
- data/lib/asciidoctor/standoc/front_contributor.rb +5 -5
- data/lib/asciidoctor/standoc/inline.rb +1 -1
- data/lib/asciidoctor/standoc/isodoc.rng +305 -4
- data/lib/asciidoctor/standoc/lists.rb +4 -2
- data/lib/asciidoctor/standoc/macros.rb +50 -23
- data/lib/asciidoctor/standoc/macros_form.rb +63 -0
- data/lib/asciidoctor/standoc/ref.rb +87 -112
- data/lib/asciidoctor/standoc/ref_date_id.rb +62 -0
- data/lib/asciidoctor/standoc/ref_sect.rb +20 -17
- data/lib/asciidoctor/standoc/section.rb +3 -1
- data/lib/asciidoctor/standoc/term_lookup_cleanup.rb +31 -16
- data/lib/asciidoctor/standoc/terms.rb +27 -16
- data/lib/asciidoctor/standoc/utils.rb +35 -9
- data/lib/asciidoctor/standoc/validate.rb +30 -28
- data/lib/metanorma-standoc.rb +0 -1
- data/lib/metanorma/standoc/version.rb +5 -5
- data/metanorma-standoc.gemspec +11 -11
- data/spec/asciidoctor/base_spec.rb +85 -19
- data/spec/asciidoctor/blocks_spec.rb +830 -727
- data/spec/asciidoctor/cleanup_sections_spec.rb +51 -14
- data/spec/asciidoctor/cleanup_spec.rb +1900 -1917
- data/spec/asciidoctor/inline_spec.rb +282 -283
- data/spec/asciidoctor/isobib_cache_spec.rb +406 -358
- data/spec/asciidoctor/lists_spec.rb +3 -3
- data/spec/asciidoctor/macros_plantuml_spec.rb +8 -8
- data/spec/asciidoctor/macros_spec.rb +546 -444
- data/spec/asciidoctor/macros_yaml2text_spec.rb +1 -1
- data/spec/asciidoctor/refs_dl_spec.rb +4 -4
- data/spec/asciidoctor/refs_spec.rb +19 -19
- data/spec/asciidoctor/section_spec.rb +778 -689
- data/spec/asciidoctor/table_spec.rb +6 -6
- data/spec/asciidoctor/validate_spec.rb +21 -21
- data/spec/spec_helper.rb +13 -9
- data/spec/vcr_cassettes/dated_iso_ref_joint_iso_iec.yml +62 -62
- data/spec/vcr_cassettes/isobib_get_123.yml +16 -16
- data/spec/vcr_cassettes/isobib_get_123_1.yml +28 -28
- data/spec/vcr_cassettes/isobib_get_123_1_fr.yml +41 -41
- data/spec/vcr_cassettes/isobib_get_123_2001.yml +16 -16
- data/spec/vcr_cassettes/isobib_get_124.yml +15 -15
- data/spec/vcr_cassettes/rfcbib_get_rfc8341.yml +14 -14
- data/spec/vcr_cassettes/separates_iev_citations_by_top_level_clause.yml +63 -61
- metadata +68 -67
- data/lib/liquid/custom_blocks/key_iterator.rb +0 -21
- data/lib/liquid/custom_blocks/with_json_nested_context.rb +0 -18
- data/lib/liquid/custom_blocks/with_yaml_nested_context.rb +0 -19
- data/lib/liquid/custom_filters/values.rb +0 -7
@@ -4,7 +4,7 @@ require "fileutils"
|
|
4
4
|
|
5
5
|
RSpec.describe Asciidoctor::Standoc do
|
6
6
|
it "appends any initial user-supplied text to boilerplate in terms and definitions" do
|
7
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
7
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
8
8
|
#{ASCIIDOC_BLANK_HDR}
|
9
9
|
== Terms and Definitions
|
10
10
|
|
@@ -36,7 +36,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
36
36
|
end
|
37
37
|
|
38
38
|
it "removes initial extraneous material from Normative References" do
|
39
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
39
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
40
40
|
#{ASCIIDOC_BLANK_HDR}
|
41
41
|
[bibliography]
|
42
42
|
== Normative References
|
@@ -69,8 +69,45 @@ RSpec.describe Asciidoctor::Standoc do
|
|
69
69
|
OUTPUT
|
70
70
|
end
|
71
71
|
|
72
|
-
|
73
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
72
|
+
it "preserves user-supplied boilerplate in Normative References" do
|
73
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
74
|
+
#{ASCIIDOC_BLANK_HDR}
|
75
|
+
[bibliography]
|
76
|
+
== Normative References
|
77
|
+
|
78
|
+
[NOTE,type=boilerplate]
|
79
|
+
--
|
80
|
+
This is extraneous information
|
81
|
+
--
|
82
|
+
|
83
|
+
* [[[iso216,ISO 216]]], _Reference_
|
84
|
+
|
85
|
+
This is also extraneous information
|
86
|
+
INPUT
|
87
|
+
#{BLANK_HDR}
|
88
|
+
<sections></sections>
|
89
|
+
<bibliography><references id="_" obligation="informative" normative="true"><title>Normative references</title>
|
90
|
+
<p id='_'>This is extraneous information</p>
|
91
|
+
<bibitem id="iso216" type="standard">
|
92
|
+
<title format="text/plain">Reference</title>
|
93
|
+
<docidentifier>ISO 216</docidentifier>
|
94
|
+
<docnumber>216</docnumber>
|
95
|
+
<contributor>
|
96
|
+
<role type="publisher"/>
|
97
|
+
<organization>
|
98
|
+
<name>ISO</name>
|
99
|
+
</organization>
|
100
|
+
</contributor>
|
101
|
+
</bibitem>
|
102
|
+
<p id='_'>This is also extraneous information</p>
|
103
|
+
</references>
|
104
|
+
</bibliography>
|
105
|
+
</standard-document>
|
106
|
+
OUTPUT
|
107
|
+
end
|
108
|
+
|
109
|
+
it "sorts references with their notes in Bibliography" do
|
110
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
74
111
|
#{ASCIIDOC_BLANK_HDR}
|
75
112
|
[bibliography]
|
76
113
|
== Bibliography
|
@@ -144,7 +181,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
144
181
|
end
|
145
182
|
|
146
183
|
it "defaults section obligations" do
|
147
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
184
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
148
185
|
#{ASCIIDOC_BLANK_HDR}
|
149
186
|
|
150
187
|
== Clause
|
@@ -169,7 +206,7 @@ end
|
|
169
206
|
end
|
170
207
|
|
171
208
|
it "extends clause levels past 5" do
|
172
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
209
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
173
210
|
#{ASCIIDOC_BLANK_HDR}
|
174
211
|
|
175
212
|
== Clause1
|
@@ -232,7 +269,7 @@ end
|
|
232
269
|
end
|
233
270
|
|
234
271
|
it "inserts boilerplate before empty Normative References" do
|
235
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
272
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
236
273
|
#{ASCIIDOC_BLANK_HDR}
|
237
274
|
|
238
275
|
[bibliography]
|
@@ -250,7 +287,7 @@ end
|
|
250
287
|
end
|
251
288
|
|
252
289
|
it "inserts boilerplate before non-empty Normative References" do
|
253
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
290
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
254
291
|
#{ASCIIDOC_BLANK_HDR}
|
255
292
|
|
256
293
|
[bibliography]
|
@@ -274,7 +311,7 @@ end
|
|
274
311
|
end
|
275
312
|
|
276
313
|
it "inserts boilerplate before empty Normative References in French" do
|
277
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
314
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
278
315
|
= Document title
|
279
316
|
Author
|
280
317
|
:docfile: test.adoc
|
@@ -298,7 +335,7 @@ it "inserts boilerplate before empty Normative References in French" do
|
|
298
335
|
end
|
299
336
|
|
300
337
|
it "processes section names, with footnotes" do
|
301
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
338
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
302
339
|
#{ASCIIDOC_BLANK_HDR}
|
303
340
|
.Foreword.footnote:[A]
|
304
341
|
|
@@ -590,7 +627,7 @@ OUTPUT
|
|
590
627
|
end
|
591
628
|
|
592
629
|
it "processes section names, default to English" do
|
593
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
630
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
594
631
|
#{ASCIIDOC_BLANK_HDR.sub(/:nodoc:/, ":language: tlh\n:script: Latn\n:nodoc:")}
|
595
632
|
.Foreword
|
596
633
|
|
@@ -821,7 +858,7 @@ OUTPUT
|
|
821
858
|
end
|
822
859
|
|
823
860
|
it "processes section names, French" do
|
824
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
861
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
825
862
|
#{ASCIIDOC_BLANK_HDR.sub(/:nodoc:/, ":language: fr\n:script: Latn\n:nodoc:")}
|
826
863
|
.Foreword
|
827
864
|
|
@@ -1055,7 +1092,7 @@ OUTPUT
|
|
1055
1092
|
end
|
1056
1093
|
|
1057
1094
|
it "processes section names, Simplified Chinese" do
|
1058
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
1095
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
1059
1096
|
#{ASCIIDOC_BLANK_HDR.sub(/:nodoc:/, ":language: zh\n:script: Hans\n:nodoc:")}
|
1060
1097
|
.Foreword
|
1061
1098
|
|
@@ -1286,7 +1323,7 @@ OUTPUT
|
|
1286
1323
|
end
|
1287
1324
|
|
1288
1325
|
it "processes section names, internationalisation file" do
|
1289
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
1326
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
1290
1327
|
#{ASCIIDOC_BLANK_HDR.sub(/:nodoc:/, ":i18nyaml: spec/assets/i18n.yaml")}
|
1291
1328
|
.Foreword
|
1292
1329
|
|
@@ -3,142 +3,134 @@ require "relaton_iec"
|
|
3
3
|
require "fileutils"
|
4
4
|
|
5
5
|
RSpec.describe Asciidoctor::Standoc do
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
10
|
-
#{ASCIIDOC_BLANK_HDR}
|
11
|
-
|
12
|
-
[svgmap%unnumbered,number=8,subsequence=A,keep-with-next=true,keep-lines-together=true]
|
13
|
-
====
|
14
|
-
* <<ref1,Computer>>; http://www.example.com
|
15
|
-
====
|
16
|
-
|
17
|
-
[[ref1]]
|
18
|
-
.SVG title
|
19
|
-
[.svgmap]
|
20
|
-
====
|
21
|
-
image::action_schemaexpg1.svg[]
|
22
|
-
|
23
|
-
* <<ref1,Computer>>; mn://action_schema
|
24
|
-
* http://www.example.com[Phone]; http://www.example.com
|
25
|
-
====
|
26
|
-
|
27
|
-
[[ref2]]
|
28
|
-
[svgmap%unnumbered,number=8,subsequence=A,keep-with-next=true,keep-lines-together=true]
|
29
|
-
====
|
30
|
-
[alt=Workmap]
|
31
|
-
image::action_schemaexpg2.svg[]
|
32
|
-
|
33
|
-
* <<ref1,Computer>>;
|
34
|
-
* http://www.example.com[Phone]; mn://basic_attribute_schema
|
35
|
-
* <<express:action_schema:action_schema.basic,Coffee>>; mn://support_resource_schema
|
36
|
-
====
|
37
|
-
INPUT
|
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
|
-
|
69
|
-
|
70
|
-
|
71
|
-
</
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
<rect x='324.69' y='450.52' class='st0' width='132.62' height='40.75'/>
|
100
|
-
</a>
|
101
|
-
<a xlink:href='mn://support_resource_schema'>
|
102
|
-
<rect x='324.69' y='528.36' class='st0' width='148.16' height='40.75'/>
|
103
|
-
</a>
|
104
|
-
</svg>
|
105
|
-
OUTPUT
|
106
|
-
end
|
107
|
-
|
108
|
-
it "processes markup in sourcecode" do
|
109
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
110
|
-
#{ASCIIDOC_BLANK_HDR}
|
111
|
-
|
112
|
-
[source]
|
113
|
-
----
|
114
|
-
<tag/>
|
115
|
-
----
|
6
|
+
it "processes svgmap" do
|
7
|
+
FileUtils.cp "spec/fixtures/action_schemaexpg1.svg", "action_schemaexpg1.svg"
|
8
|
+
FileUtils.cp "spec/fixtures/action_schemaexpg1.svg", "action_schemaexpg2.svg"
|
9
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS))).gsub(%r{<image.*?</image>}m, "<image/>").gsub(%r{<style.*?</style>}m, "<style/>")).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
10
|
+
#{ASCIIDOC_BLANK_HDR}
|
11
|
+
|
12
|
+
[svgmap%unnumbered,number=8,subsequence=A,keep-with-next=true,keep-lines-together=true]
|
13
|
+
====
|
14
|
+
* <<ref1,Computer>>; http://www.example.com
|
15
|
+
====
|
16
|
+
|
17
|
+
[[ref1]]
|
18
|
+
.SVG title
|
19
|
+
[.svgmap]
|
20
|
+
====
|
21
|
+
image::action_schemaexpg1.svg[]
|
22
|
+
|
23
|
+
* <<ref1,Computer>>; mn://action_schema
|
24
|
+
* http://www.example.com[Phone]; http://www.example.com
|
25
|
+
====
|
26
|
+
|
27
|
+
[[ref2]]
|
28
|
+
[svgmap%unnumbered,number=8,subsequence=A,keep-with-next=true,keep-lines-together=true]
|
29
|
+
====
|
30
|
+
[alt=Workmap]
|
31
|
+
image::action_schemaexpg2.svg[]
|
32
|
+
|
33
|
+
* <<ref1,Computer>>; mn://action_schema
|
34
|
+
* http://www.example.com[Phone]; mn://basic_attribute_schema
|
35
|
+
* <<express:action_schema:action_schema.basic,Coffee>>; mn://support_resource_schema
|
36
|
+
====
|
37
|
+
INPUT
|
38
|
+
#{BLANK_HDR}
|
39
|
+
<sections>
|
40
|
+
<svgmap unnumbered='true' number='8' subsequence='A' keep-with-next='true' keep-lines-together='true'>
|
41
|
+
<target href='http://www.example.com'>
|
42
|
+
<xref target='ref1'>Computer</xref>
|
43
|
+
</target>
|
44
|
+
</svgmap>
|
45
|
+
<figure id='ref1'>
|
46
|
+
<name>SVG title</name>
|
47
|
+
<svg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' version='1.1' id='Layer_1_000000001' x='0px' y='0px' viewBox='0 0 595.28 841.89' style='enable-background:new 0 0 595.28 841.89;' xml:space='preserve'>
|
48
|
+
<style/>
|
49
|
+
<image/>
|
50
|
+
<a xlink:href='#ref1'>
|
51
|
+
<rect x='123.28' y='273.93' class='st0' width='88.05' height='41.84'/>
|
52
|
+
</a>
|
53
|
+
<a xlink:href='mn://basic_attribute_schema'>
|
54
|
+
<rect x='324.69' y='450.52' class='st0' width='132.62' height='40.75'/>
|
55
|
+
</a>
|
56
|
+
<a xlink:href='mn://support_resource_schema'>
|
57
|
+
<rect x='324.69' y='528.36' class='st0' width='148.16' height='40.75'/>
|
58
|
+
</a>
|
59
|
+
</svg>
|
60
|
+
</figure>
|
61
|
+
<svgmap>
|
62
|
+
<figure id='ref2' unnumbered='true' number='8' subsequence='A' keep-with-next='true' keep-lines-together='true'>
|
63
|
+
<svg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' version='1.1' id='Layer_1_000000002' x='0px' y='0px' viewBox='0 0 595.28 841.89' style='enable-background:new 0 0 595.28 841.89;' xml:space='preserve'>
|
64
|
+
<style/>
|
65
|
+
<image/>
|
66
|
+
<a xlink:href='#ref1'>
|
67
|
+
<rect x='123.28' y='273.93' class='st0' width='88.05' height='41.84'/>
|
68
|
+
</a>
|
69
|
+
<a xlink:href='http://www.example.com'>
|
70
|
+
<rect x='324.69' y='450.52' class='st0' width='132.62' height='40.75'/>
|
71
|
+
</a>
|
72
|
+
<a xlink:href='mn://support_resource_schema'>
|
73
|
+
<rect x='324.69' y='528.36' class='st0' width='148.16' height='40.75'/>
|
74
|
+
</a>
|
75
|
+
</svg>
|
76
|
+
</figure>
|
77
|
+
<target href='mn://support_resource_schema'>
|
78
|
+
<eref bibitemid='express_action_schema' citeas=''>
|
79
|
+
<localityStack>
|
80
|
+
<locality type='anchor'>
|
81
|
+
<referenceFrom>action_schema.basic</referenceFrom>
|
82
|
+
</locality>
|
83
|
+
</localityStack>
|
84
|
+
Coffee
|
85
|
+
</eref>
|
86
|
+
</target>
|
87
|
+
</svgmap>
|
88
|
+
</sections>
|
89
|
+
<bibliography>
|
90
|
+
<references hidden='true' normative='false'>
|
91
|
+
<bibitem id='express_action_schema' type='internal'>
|
92
|
+
<docidentifier type='repository'>express/action_schema</docidentifier>
|
93
|
+
</bibitem>
|
94
|
+
</references>
|
95
|
+
</bibliography>
|
96
|
+
</standard-document>
|
97
|
+
OUTPUT
|
98
|
+
end
|
116
99
|
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
100
|
+
it "processes markup in sourcecode" do
|
101
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
102
|
+
#{ASCIIDOC_BLANK_HDR}
|
103
|
+
|
104
|
+
[source]
|
105
|
+
----
|
106
|
+
<tag/>
|
107
|
+
----
|
108
|
+
|
109
|
+
[[A]]
|
110
|
+
[source]
|
111
|
+
----
|
112
|
+
var {{{*x*}}} : {{{<<A,recursive>>}}} <tag/>
|
113
|
+
----
|
122
114
|
|
123
115
|
|
124
116
|
INPUT
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
</sections>
|
136
|
-
|
117
|
+
#{BLANK_HDR}
|
118
|
+
<sections>
|
119
|
+
<sourcecode id='_'><tag/></sourcecode>
|
120
|
+
<sourcecode id='A'>
|
121
|
+
var
|
122
|
+
<strong>x</strong>
|
123
|
+
:
|
124
|
+
<xref target='A'>recursive</xref>
|
125
|
+
<tag/>
|
126
|
+
</sourcecode>
|
127
|
+
</sections>
|
128
|
+
</standard-document>
|
137
129
|
OUTPUT
|
138
130
|
end
|
139
131
|
|
140
|
-
|
141
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
132
|
+
it "processes markup in sourcecode with custom delimiters" do
|
133
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
142
134
|
= Document title
|
143
135
|
Author
|
144
136
|
:docfile: test.adoc
|
@@ -156,40 +148,39 @@ OUTPUT
|
|
156
148
|
|
157
149
|
|
158
150
|
INPUT
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
</sections>
|
168
|
-
|
151
|
+
#{BLANK_HDR}
|
152
|
+
<sections>
|
153
|
+
<sourcecode id='A'>
|
154
|
+
var
|
155
|
+
<strong>x</strong>
|
156
|
+
:
|
157
|
+
<xref target='A'>recursive</xref>
|
158
|
+
</sourcecode>
|
159
|
+
</sections>
|
160
|
+
</standard-document>
|
169
161
|
OUTPUT
|
170
162
|
end
|
171
163
|
|
172
|
-
|
173
164
|
it "applies smartquotes by default" do
|
174
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
165
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
175
166
|
#{ASCIIDOC_BLANK_HDR}
|
176
167
|
== "Quotation" A's
|
177
168
|
|
178
169
|
'24:00:00'.
|
179
170
|
INPUT
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
</clause>
|
186
|
-
|
187
|
-
|
171
|
+
#{BLANK_HDR}
|
172
|
+
<sections>
|
173
|
+
<clause id="_" inline-header="false" obligation="normative">
|
174
|
+
<title>“Quotation” A’s</title>
|
175
|
+
<p id='_'>‘24:00:00’.</p>
|
176
|
+
</clause>
|
177
|
+
</sections>
|
178
|
+
</standard-document>
|
188
179
|
OUTPUT
|
189
180
|
end
|
190
181
|
|
191
182
|
it "applies smartquotes when requested" do
|
192
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
183
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
193
184
|
= Document title
|
194
185
|
Author
|
195
186
|
:docfile: test.adoc
|
@@ -200,18 +191,18 @@ OUTPUT
|
|
200
191
|
|
201
192
|
== "Quotation" A's
|
202
193
|
INPUT
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
</clause>
|
208
|
-
|
209
|
-
|
194
|
+
#{BLANK_HDR}
|
195
|
+
<sections>
|
196
|
+
<clause id="_" inline-header="false" obligation="normative">
|
197
|
+
<title>“Quotation” A’s</title>
|
198
|
+
</clause>
|
199
|
+
</sections>
|
200
|
+
</standard-document>
|
210
201
|
OUTPUT
|
211
202
|
end
|
212
203
|
|
213
|
-
|
214
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
204
|
+
it "does not apply smartquotes when requested not to" do
|
205
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
215
206
|
= Document title
|
216
207
|
Author
|
217
208
|
:docfile: test.adoc
|
@@ -224,21 +215,21 @@ OUTPUT
|
|
224
215
|
|
225
216
|
`"quote" A's`
|
226
217
|
INPUT
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
<p id="_">
|
232
|
-
|
233
|
-
</p>
|
234
|
-
</clause>
|
235
|
-
|
236
|
-
|
218
|
+
#{BLANK_HDR}
|
219
|
+
<sections>
|
220
|
+
<clause id="_" inline-header="false" obligation="normative">
|
221
|
+
<title>"Quotation" A's</title>
|
222
|
+
<p id="_">
|
223
|
+
<tt>"quote" A's</tt>
|
224
|
+
</p>
|
225
|
+
</clause>
|
226
|
+
</sections>
|
227
|
+
</standard-document>
|
237
228
|
OUTPUT
|
238
229
|
end
|
239
230
|
|
240
231
|
it "does not apply smartquotes to sourcecode, tt, pre, pseudocode" do
|
241
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
232
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
242
233
|
= Document title
|
243
234
|
Author
|
244
235
|
:docfile: test.adoc
|
@@ -264,56 +255,56 @@ OUTPUT
|
|
264
255
|
====
|
265
256
|
|
266
257
|
INPUT
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
<p id="_">
|
271
|
-
|
272
|
-
</p>
|
273
|
-
<sourcecode id="_">"quote" A's</sourcecode>
|
274
|
-
<figure id='_' class='pseudocode'>
|
275
|
-
|
276
|
-
</figure>
|
277
|
-
</clause>
|
278
|
-
|
279
|
-
|
258
|
+
#{BLANK_HDR}
|
259
|
+
<sections>
|
260
|
+
<clause id="_" inline-header="false" obligation="normative"><title>“Quotation” A’s</title><p id="_">“Quotation” A’s</p>
|
261
|
+
<p id="_">
|
262
|
+
<tt>"quote" A’s</tt>
|
263
|
+
</p>
|
264
|
+
<sourcecode id="_">"quote" A's</sourcecode>
|
265
|
+
<figure id='_' class='pseudocode'>
|
266
|
+
<p id='_'>"quote" A's</p>
|
267
|
+
</figure>
|
268
|
+
</clause>
|
269
|
+
</sections>
|
270
|
+
</standard-document>
|
280
271
|
OUTPUT
|
281
272
|
end
|
282
273
|
|
283
274
|
it "handles < > & in Asciidoctor correctly" do
|
284
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
275
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
285
276
|
#{ASCIIDOC_BLANK_HDR}
|
286
277
|
== {blank}
|
287
278
|
|
288
279
|
<&>
|
289
280
|
INPUT
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
<p id="_"><&></p>
|
294
|
-
|
295
|
-
|
296
|
-
|
281
|
+
#{BLANK_HDR}
|
282
|
+
<sections>
|
283
|
+
<clause id="_" inline-header="false" obligation="normative">
|
284
|
+
<p id="_"><&></p>
|
285
|
+
</clause>
|
286
|
+
</sections>
|
287
|
+
</standard-document>
|
297
288
|
OUTPUT
|
298
289
|
end
|
299
290
|
|
300
291
|
it "removes empty text elements" do
|
301
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
292
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
302
293
|
#{ASCIIDOC_BLANK_HDR}
|
303
294
|
== {blank}
|
304
295
|
INPUT
|
305
|
-
|
306
|
-
|
307
|
-
|
296
|
+
#{BLANK_HDR}
|
297
|
+
<sections>
|
298
|
+
<clause id="_" inline-header="false" obligation="normative">
|
308
299
|
|
309
|
-
|
310
|
-
|
311
|
-
|
300
|
+
</clause>
|
301
|
+
</sections>
|
302
|
+
</standard-document>
|
312
303
|
OUTPUT
|
313
304
|
end
|
314
305
|
|
315
306
|
it "processes stem-only terms as admitted" do
|
316
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
307
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
317
308
|
#{ASCIIDOC_BLANK_HDR}
|
318
309
|
== Terms and Definitions
|
319
310
|
|
@@ -323,35 +314,35 @@ OUTPUT
|
|
323
314
|
|
324
315
|
Time
|
325
316
|
INPUT
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
</mrow>
|
335
|
-
<mrow>
|
336
|
-
|
337
|
-
</mrow>
|
338
|
-
</msub></math></stem></preferred><admitted><stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><msub>
|
339
|
-
<mrow>
|
340
|
-
|
341
|
-
</mrow>
|
342
|
-
<mrow>
|
343
|
-
|
344
|
-
</mrow>
|
345
|
-
</msub></math></stem></admitted>
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
317
|
+
#{BLANK_HDR}
|
318
|
+
<sections>
|
319
|
+
<terms id="_" obligation="normative">
|
320
|
+
<title>Terms and definitions</title>
|
321
|
+
<p id="_">For the purposes of this document, the following terms and definitions apply.</p>
|
322
|
+
<term id="term-t90"><preferred><stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><msub>
|
323
|
+
<mrow>
|
324
|
+
<mi>t</mi>
|
325
|
+
</mrow>
|
326
|
+
<mrow>
|
327
|
+
<mn>90</mn>
|
328
|
+
</mrow>
|
329
|
+
</msub></math></stem></preferred><admitted><stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><msub>
|
330
|
+
<mrow>
|
331
|
+
<mi>t</mi>
|
332
|
+
</mrow>
|
333
|
+
<mrow>
|
334
|
+
<mn>91</mn>
|
335
|
+
</mrow>
|
336
|
+
</msub></math></stem></admitted>
|
337
|
+
<definition><p id="_">Time</p></definition></term>
|
338
|
+
</terms>
|
339
|
+
</sections>
|
340
|
+
</standard-document>
|
350
341
|
OUTPUT
|
351
342
|
end
|
352
343
|
|
353
344
|
it "moves term domains out of the term definition paragraph" do
|
354
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
345
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
355
346
|
#{ASCIIDOC_BLANK_HDR}
|
356
347
|
== Terms and Definitions
|
357
348
|
|
@@ -365,31 +356,31 @@ OUTPUT
|
|
365
356
|
|
366
357
|
domain:[relativity2]
|
367
358
|
INPUT
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
</term>
|
385
|
-
|
386
|
-
|
387
|
-
|
359
|
+
#{BLANK_HDR}
|
360
|
+
<sections>
|
361
|
+
<terms id="_" obligation="normative">
|
362
|
+
<title>Terms and definitions</title>
|
363
|
+
<p id="_">For the purposes of this document, the following terms and definitions apply.</p>
|
364
|
+
<term id="term-tempus">
|
365
|
+
<preferred>Tempus</preferred>
|
366
|
+
<domain>relativity</domain><definition><p id="_"> Time</p></definition>
|
367
|
+
</term>
|
368
|
+
<term id='term-tempus1'>
|
369
|
+
<preferred>Tempus1</preferred>
|
370
|
+
<domain>relativity2</domain>
|
371
|
+
<definition>
|
372
|
+
<p id='_'>Time2</p>
|
373
|
+
<p id='_'> </p>
|
374
|
+
</definition>
|
375
|
+
</term>
|
376
|
+
</terms>
|
377
|
+
</sections>
|
378
|
+
</standard-document>
|
388
379
|
OUTPUT
|
389
380
|
end
|
390
381
|
|
391
382
|
it "permits multiple blocks in term definition paragraph" do
|
392
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
383
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
393
384
|
= Document title
|
394
385
|
Author
|
395
386
|
:docfile: test.adoc
|
@@ -408,64 +399,63 @@ OUTPUT
|
|
408
399
|
|
409
400
|
This paragraph is extraneous
|
410
401
|
INPUT
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
</msub></math></stem></preferred><definition><formula id="_">
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
</mrow>
|
428
|
-
<mrow>
|
429
|
-
|
430
|
-
</mrow>
|
431
|
-
</msub></math></stem>
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
402
|
+
#{BLANK_HDR}
|
403
|
+
<sections>
|
404
|
+
<terms id="_" obligation="normative">
|
405
|
+
<title>Terms and definitions</title>
|
406
|
+
<p id="_">For the purposes of this document, the following terms and definitions apply.</p>
|
407
|
+
<term id="term-t90"><preferred><stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><msub>
|
408
|
+
<mrow>
|
409
|
+
<mi>t</mi>
|
410
|
+
</mrow>
|
411
|
+
<mrow>
|
412
|
+
<mn>90</mn>
|
413
|
+
</mrow>
|
414
|
+
</msub></math></stem></preferred><definition><formula id="_">
|
415
|
+
<stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><msub>
|
416
|
+
<mrow>
|
417
|
+
<mi>t</mi>
|
418
|
+
</mrow>
|
419
|
+
<mrow>
|
420
|
+
<mi>A</mi>
|
421
|
+
</mrow>
|
422
|
+
</msub></math></stem>
|
423
|
+
</formula>
|
424
|
+
<p id="_">This paragraph is extraneous</p></definition>
|
425
|
+
</term>
|
426
|
+
</terms>
|
427
|
+
</sections>
|
428
|
+
</standard-document>
|
438
429
|
OUTPUT
|
439
430
|
end
|
440
431
|
|
441
432
|
it "moves notes inside preceding blocks, if they are not at clause end, and the blocks are not delimited" do
|
442
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
443
|
-
|
444
|
-
|
445
|
-
[stem]
|
446
|
-
++++
|
447
|
-
r = 1 %
|
448
|
-
r = 1 %
|
449
|
-
++++
|
433
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
434
|
+
#{ASCIIDOC_BLANK_HDR}
|
450
435
|
|
451
|
-
|
436
|
+
[stem]
|
437
|
+
++++
|
438
|
+
r = 1 %
|
439
|
+
r = 1 %
|
440
|
+
++++
|
452
441
|
|
453
|
-
|
442
|
+
NOTE: That formula does not do much
|
443
|
+
|
444
|
+
Indeed.
|
454
445
|
INPUT
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
<note id="_">
|
459
|
-
|
460
|
-
</note></formula>
|
461
|
-
|
462
|
-
|
463
|
-
</standard-document>
|
446
|
+
#{BLANK_HDR}
|
447
|
+
<sections><formula id="_">
|
448
|
+
<stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>r</mi><mo>=</mo><mn>1</mn><mi>%</mi><mi>r</mi><mo>=</mo><mn>1</mn><mi>%</mi></math></stem>
|
449
|
+
<note id="_">
|
450
|
+
<p id="_">That formula does not do much</p>
|
451
|
+
</note></formula>
|
452
|
+
<p id="_">Indeed.</p></sections>
|
453
|
+
</standard-document>
|
464
454
|
OUTPUT
|
465
455
|
end
|
466
456
|
|
467
|
-
|
468
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
457
|
+
it "does not move notes inside preceding blocks, if they are marked as keep-separate" do
|
458
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
469
459
|
#{ASCIIDOC_BLANK_HDR}
|
470
460
|
|
471
461
|
[stem]
|
@@ -481,20 +471,19 @@ OUTPUT
|
|
481
471
|
|
482
472
|
Indeed.
|
483
473
|
INPUT
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
<note id="_">
|
488
|
-
|
489
|
-
</note>
|
490
|
-
|
491
|
-
|
492
|
-
</standard-document>
|
474
|
+
#{BLANK_HDR}
|
475
|
+
<sections><formula id="_">
|
476
|
+
<stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>r</mi><mo>=</mo><mn>1</mn><mi>%</mi><mi>r</mi><mo>=</mo><mn>1</mn><mi>%</mi></math></stem></formula>
|
477
|
+
<note id="_">
|
478
|
+
<p id="_">That formula does not do much</p>
|
479
|
+
</note>
|
480
|
+
<p id="_">Indeed.</p></sections>
|
481
|
+
</standard-document>
|
493
482
|
OUTPUT
|
494
483
|
end
|
495
484
|
|
496
485
|
it "does not move notes inside preceding blocks, if they are at clause end" do
|
497
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
486
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
498
487
|
#{ASCIIDOC_BLANK_HDR}
|
499
488
|
[source,ruby]
|
500
489
|
[1...x].each do |y|
|
@@ -503,21 +492,22 @@ OUTPUT
|
|
503
492
|
|
504
493
|
NOTE: That loop does not do much
|
505
494
|
INPUT
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
495
|
+
#{BLANK_HDR}
|
496
|
+
<sections><sourcecode id="_" lang="ruby">[1...x].each do |y|
|
497
|
+
puts y
|
498
|
+
end</sourcecode>
|
499
|
+
<note id="_">
|
500
|
+
<p id="_">That loop does not do much</p>
|
501
|
+
</note></sections>
|
502
|
+
</standard-document>
|
514
503
|
OUTPUT
|
515
504
|
end
|
516
505
|
|
517
506
|
it "converts xrefs to references into erefs" do
|
518
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
507
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
519
508
|
#{ASCIIDOC_BLANK_HDR}
|
520
509
|
<<iso216>>
|
510
|
+
<<iso216,droploc%capital%>>
|
521
511
|
|
522
512
|
[bibliography]
|
523
513
|
== Normative References
|
@@ -528,6 +518,7 @@ OUTPUT
|
|
528
518
|
<title>Foreword</title>
|
529
519
|
<p id="_">
|
530
520
|
<eref type="inline" bibitemid="iso216" citeas="ISO 216:2001"/>
|
521
|
+
<eref type='inline' case='capital' droploc='true' bibitemid='iso216' citeas='ISO 216:2001'/>
|
531
522
|
</p>
|
532
523
|
</foreword></preface><sections>
|
533
524
|
</sections><bibliography><references id="_" obligation="informative" normative="true">
|
@@ -554,104 +545,115 @@ OUTPUT
|
|
554
545
|
end
|
555
546
|
|
556
547
|
it "extracts localities from erefs" do
|
557
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
548
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
558
549
|
#{ASCIIDOC_BLANK_HDR}
|
559
550
|
<<iso216,whole,clause=3,example=9-11,locality:prelude="33 a",locality:entirety:the reference,xyz>>
|
560
551
|
<<iso216,whole,clause=3,example=9-11,locality:prelude=33,locality:entirety="the reference";whole,clause=3,example=9-11,locality:prelude=33,locality:entirety:the reference,xyz>>
|
561
552
|
<<iso216,_whole_>>
|
562
553
|
<<iso216,a _whole_ flagon>>
|
563
554
|
<<iso216,whole,clause=3,a _whole_ flagon>>
|
555
|
+
<<iso216,droploc%capital%whole,clause=3,a _whole_ flagon>>
|
564
556
|
|
565
557
|
[bibliography]
|
566
558
|
== Normative References
|
567
559
|
* [[[iso216,ISO 216]]], _Reference_
|
568
560
|
INPUT
|
569
|
-
|
570
|
-
|
571
|
-
|
572
|
-
|
573
|
-
|
561
|
+
#{BLANK_HDR}
|
562
|
+
<preface><foreword id="_" obligation="informative">
|
563
|
+
<title>Foreword</title>
|
564
|
+
<p id="_">
|
565
|
+
<eref type="inline" bibitemid="iso216" citeas="ISO 216">
|
566
|
+
<localityStack>
|
567
|
+
<locality type="whole"/><locality type="clause"><referenceFrom>3</referenceFrom></locality><locality type="example"><referenceFrom>9</referenceFrom><referenceTo>11</referenceTo></locality><locality type="locality:prelude"><referenceFrom>33 a</referenceFrom></locality><locality type="locality:entirety"/>
|
568
|
+
</localityStack>
|
569
|
+
the reference,xyz</eref>
|
570
|
+
<eref type='inline' bibitemid='iso216' citeas='ISO 216'>
|
571
|
+
<localityStack>
|
572
|
+
<locality type='whole'/>
|
573
|
+
<locality type='clause'>
|
574
|
+
<referenceFrom>3</referenceFrom>
|
575
|
+
</locality>
|
576
|
+
<locality type='example'>
|
577
|
+
<referenceFrom>9</referenceFrom>
|
578
|
+
<referenceTo>11</referenceTo>
|
579
|
+
</locality>
|
580
|
+
<locality type='locality:prelude'>
|
581
|
+
<referenceFrom>33</referenceFrom>
|
582
|
+
</locality>
|
583
|
+
<locality type='locality:entirety'>
|
584
|
+
<referenceFrom>the reference</referenceFrom>
|
585
|
+
</locality>
|
586
|
+
</localityStack>
|
587
|
+
<localityStack>
|
588
|
+
<locality type='whole'/>
|
589
|
+
<locality type='clause'>
|
590
|
+
<referenceFrom>3</referenceFrom>
|
591
|
+
</locality>
|
592
|
+
<locality type='example'>
|
593
|
+
<referenceFrom>9</referenceFrom>
|
594
|
+
<referenceTo>11</referenceTo>
|
595
|
+
</locality>
|
596
|
+
<locality type='locality:prelude'>
|
597
|
+
<referenceFrom>33</referenceFrom>
|
598
|
+
</locality>
|
599
|
+
<locality type='locality:entirety'/>
|
600
|
+
</localityStack>
|
601
|
+
the reference,xyz
|
602
|
+
</eref>
|
603
|
+
<eref type='inline' bibitemid='iso216' citeas='ISO 216'>
|
604
|
+
<em>whole</em>
|
605
|
+
</eref>
|
606
|
+
<eref type='inline' bibitemid='iso216' citeas='ISO 216'>
|
607
|
+
a
|
608
|
+
<em>whole</em>
|
609
|
+
flagon
|
610
|
+
</eref>
|
611
|
+
<eref type='inline' bibitemid='iso216' citeas='ISO 216'>
|
574
612
|
<localityStack>
|
575
|
-
|
613
|
+
<locality type='whole'/>
|
614
|
+
<locality type='clause'>
|
615
|
+
<referenceFrom>3</referenceFrom>
|
616
|
+
</locality>
|
576
617
|
</localityStack>
|
577
|
-
|
578
|
-
|
579
|
-
|
580
|
-
|
581
|
-
|
582
|
-
|
583
|
-
|
584
|
-
|
585
|
-
|
586
|
-
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
|
591
|
-
|
592
|
-
|
593
|
-
|
594
|
-
|
595
|
-
|
596
|
-
|
597
|
-
|
598
|
-
|
599
|
-
|
600
|
-
|
601
|
-
|
602
|
-
|
603
|
-
|
604
|
-
|
605
|
-
|
606
|
-
|
607
|
-
|
608
|
-
|
609
|
-
|
610
|
-
|
611
|
-
<eref type='inline' bibitemid='iso216' citeas='ISO 216'>
|
612
|
-
<em>whole</em>
|
613
|
-
</eref>
|
614
|
-
<eref type='inline' bibitemid='iso216' citeas='ISO 216'>
|
615
|
-
a
|
616
|
-
<em>whole</em>
|
617
|
-
flagon
|
618
|
-
</eref>
|
619
|
-
<eref type='inline' bibitemid='iso216' citeas='ISO 216'>
|
620
|
-
<localityStack>
|
621
|
-
<locality type='whole'/>
|
622
|
-
<locality type='clause'>
|
623
|
-
<referenceFrom>3</referenceFrom>
|
624
|
-
</locality>
|
625
|
-
</localityStack>
|
626
|
-
a
|
627
|
-
<em>whole</em>
|
628
|
-
flagon
|
629
|
-
</eref>
|
630
|
-
</p>
|
631
|
-
</foreword></preface><sections>
|
632
|
-
</sections><bibliography><references id="_" obligation="informative" normative="true">
|
633
|
-
<title>Normative references</title>
|
634
|
-
#{NORM_REF_BOILERPLATE}
|
635
|
-
<bibitem id="iso216" type="standard">
|
636
|
-
<title format="text/plain">Reference</title>
|
637
|
-
<docidentifier>ISO 216</docidentifier>
|
638
|
-
<docnumber>216</docnumber>
|
639
|
-
<contributor>
|
640
|
-
<role type="publisher"/>
|
641
|
-
<organization>
|
642
|
-
<name>ISO</name>
|
643
|
-
</organization>
|
644
|
-
</contributor>
|
645
|
-
</bibitem>
|
646
|
-
</references>
|
647
|
-
</bibliography>
|
648
|
-
</standard-document>
|
618
|
+
a
|
619
|
+
<em>whole</em>
|
620
|
+
flagon
|
621
|
+
</eref>
|
622
|
+
<eref type='inline' case='capital' droploc='true' bibitemid='iso216' citeas='ISO 216'>
|
623
|
+
<localityStack>
|
624
|
+
<locality type='whole'/>
|
625
|
+
<locality type='clause'>
|
626
|
+
<referenceFrom>3</referenceFrom>
|
627
|
+
</locality>
|
628
|
+
</localityStack>
|
629
|
+
a
|
630
|
+
<em>whole</em>
|
631
|
+
flagon
|
632
|
+
</eref>
|
633
|
+
</p>
|
634
|
+
</foreword></preface><sections>
|
635
|
+
</sections><bibliography><references id="_" obligation="informative" normative="true">
|
636
|
+
<title>Normative references</title>
|
637
|
+
#{NORM_REF_BOILERPLATE}
|
638
|
+
<bibitem id="iso216" type="standard">
|
639
|
+
<title format="text/plain">Reference</title>
|
640
|
+
<docidentifier>ISO 216</docidentifier>
|
641
|
+
<docnumber>216</docnumber>
|
642
|
+
<contributor>
|
643
|
+
<role type="publisher"/>
|
644
|
+
<organization>
|
645
|
+
<name>ISO</name>
|
646
|
+
</organization>
|
647
|
+
</contributor>
|
648
|
+
</bibitem>
|
649
|
+
</references>
|
650
|
+
</bibliography>
|
651
|
+
</standard-document>
|
649
652
|
OUTPUT
|
650
653
|
end
|
651
654
|
|
652
|
-
|
653
655
|
it "strips type from xrefs" do
|
654
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
656
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
655
657
|
#{ASCIIDOC_BLANK_HDR}
|
656
658
|
<<iso216>>
|
657
659
|
|
@@ -659,34 +661,34 @@ OUTPUT
|
|
659
661
|
== Clause
|
660
662
|
* [[[iso216,ISO 216]]], _Reference_
|
661
663
|
INPUT
|
662
|
-
|
663
|
-
|
664
|
-
|
665
|
-
|
666
|
-
|
667
|
-
|
668
|
-
|
669
|
-
|
670
|
-
|
671
|
-
|
672
|
-
|
673
|
-
|
674
|
-
|
675
|
-
|
676
|
-
|
677
|
-
|
678
|
-
|
679
|
-
|
680
|
-
|
681
|
-
|
682
|
-
</bibitem>
|
683
|
-
</references></bibliography>
|
684
|
-
|
664
|
+
#{BLANK_HDR}
|
665
|
+
<preface>
|
666
|
+
<foreword id="_" obligation="informative">
|
667
|
+
<title>Foreword</title>
|
668
|
+
<p id="_">
|
669
|
+
<eref type="inline" bibitemid="iso216" citeas="ISO 216"/>
|
670
|
+
</p>
|
671
|
+
</foreword></preface><sections>
|
672
|
+
</sections><bibliography><references id="_" obligation="informative" normative="false">
|
673
|
+
<title>Bibliography</title>
|
674
|
+
<bibitem id="iso216" type="standard">
|
675
|
+
<title format="text/plain">Reference</title>
|
676
|
+
<docidentifier>ISO 216</docidentifier>
|
677
|
+
<docnumber>216</docnumber>
|
678
|
+
<contributor>
|
679
|
+
<role type="publisher"/>
|
680
|
+
<organization>
|
681
|
+
<name>ISO</name>
|
682
|
+
</organization>
|
683
|
+
</contributor>
|
684
|
+
</bibitem>
|
685
|
+
</references></bibliography>
|
686
|
+
</standard-document>
|
685
687
|
OUTPUT
|
686
688
|
end
|
687
689
|
|
688
690
|
it "processes localities in term sources" do
|
689
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
691
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
690
692
|
#{ASCIIDOC_BLANK_HDR}
|
691
693
|
== Terms and Definitions
|
692
694
|
|
@@ -694,63 +696,63 @@ OUTPUT
|
|
694
696
|
|
695
697
|
[.source]
|
696
698
|
<<ISO2191,section=1>>
|
697
|
-
|
698
|
-
|
699
|
-
|
700
|
-
|
701
|
-
|
702
|
-
|
703
|
-
|
704
|
-
|
705
|
-
|
706
|
-
|
707
|
-
|
708
|
-
|
709
|
-
|
710
|
-
|
711
|
-
|
712
|
-
|
713
|
-
|
714
|
-
|
715
|
-
|
716
|
-
|
699
|
+
INPUT
|
700
|
+
#{BLANK_HDR}
|
701
|
+
<sections>
|
702
|
+
<terms id="_" obligation="normative">
|
703
|
+
<title>Terms and definitions</title>
|
704
|
+
<p id="_">For the purposes of this document, the following terms and definitions apply.</p>
|
705
|
+
<term id="term-term1">
|
706
|
+
<preferred>Term1</preferred>
|
707
|
+
<termsource status="identical">
|
708
|
+
<origin bibitemid="ISO2191" type="inline" citeas="">
|
709
|
+
<localityStack>
|
710
|
+
<locality type="section"><referenceFrom>1</referenceFrom></locality>
|
711
|
+
</localityStack>
|
712
|
+
</origin>
|
713
|
+
</termsource>
|
714
|
+
</term>
|
715
|
+
</terms>
|
716
|
+
</sections>
|
717
|
+
</standard-document>
|
718
|
+
OUTPUT
|
717
719
|
end
|
718
720
|
|
719
721
|
it "inserts IDs into paragraphs" do
|
720
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
722
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
721
723
|
#{ASCIIDOC_BLANK_HDR}
|
722
724
|
Paragraph
|
723
725
|
INPUT
|
724
|
-
|
725
|
-
|
726
|
-
|
727
|
-
|
728
|
-
|
726
|
+
#{BLANK_HDR}
|
727
|
+
<sections>
|
728
|
+
<p id="_">Paragraph</p>
|
729
|
+
</sections>
|
730
|
+
</standard-document>
|
729
731
|
OUTPUT
|
730
732
|
end
|
731
733
|
|
732
734
|
it "inserts IDs into notes" do
|
733
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
735
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
734
736
|
#{ASCIIDOC_BLANK_HDR}
|
735
737
|
[example]
|
736
738
|
====
|
737
739
|
NOTE: This note has no ID
|
738
740
|
====
|
739
741
|
INPUT
|
740
|
-
|
741
|
-
|
742
|
-
|
743
|
-
|
744
|
-
|
745
|
-
|
746
|
-
|
747
|
-
|
748
|
-
|
742
|
+
#{BLANK_HDR}
|
743
|
+
<sections>
|
744
|
+
<example id="_">
|
745
|
+
<note id="_">
|
746
|
+
<p id="_">This note has no ID</p>
|
747
|
+
</note>
|
748
|
+
</example>
|
749
|
+
</sections>
|
750
|
+
</standard-document>
|
749
751
|
OUTPUT
|
750
752
|
end
|
751
753
|
|
752
754
|
it "moves table key inside table" do
|
753
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
755
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
754
756
|
#{ASCIIDOC_BLANK_HDR}
|
755
757
|
|===
|
756
758
|
|a |b |c
|
@@ -773,60 +775,60 @@ OUTPUT
|
|
773
775
|
|
774
776
|
a:: b
|
775
777
|
INPUT
|
776
|
-
|
777
|
-
|
778
|
-
|
779
|
-
|
780
|
-
|
781
|
-
|
782
|
-
|
783
|
-
|
784
|
-
|
785
|
-
|
786
|
-
|
787
|
-
|
788
|
-
|
789
|
-
|
790
|
-
|
791
|
-
|
792
|
-
|
793
|
-
|
794
|
-
|
795
|
-
|
796
|
-
|
797
|
-
|
798
|
-
|
799
|
-
|
800
|
-
|
801
|
-
|
802
|
-
|
803
|
-
|
804
|
-
|
805
|
-
|
806
|
-
|
807
|
-
|
808
|
-
|
809
|
-
|
810
|
-
|
811
|
-
|
812
|
-
|
813
|
-
|
814
|
-
|
815
|
-
|
816
|
-
|
817
|
-
|
818
|
-
|
819
|
-
|
820
|
-
|
821
|
-
|
822
|
-
|
823
|
-
|
824
|
-
|
778
|
+
#{BLANK_HDR}
|
779
|
+
<sections>
|
780
|
+
<table id='_'>
|
781
|
+
<tbody>
|
782
|
+
<tr>
|
783
|
+
<td valign='top' align='left'>a</td>
|
784
|
+
<td valign='top' align='left'>b</td>
|
785
|
+
<td valign='top' align='left'>c</td>
|
786
|
+
</tr>
|
787
|
+
</tbody>
|
788
|
+
<dl id='_' key='true'>
|
789
|
+
<dt>a</dt>
|
790
|
+
<dd>
|
791
|
+
<p id='_'>b</p>
|
792
|
+
</dd>
|
793
|
+
</dl>
|
794
|
+
</table>
|
795
|
+
<table id='_'>
|
796
|
+
<tbody>
|
797
|
+
<tr>
|
798
|
+
<td valign='top' align='left'>a</td>
|
799
|
+
<td valign='top' align='left'>b</td>
|
800
|
+
<td valign='top' align='left'>c</td>
|
801
|
+
</tr>
|
802
|
+
</tbody>
|
803
|
+
<dl id='_' key='true'>
|
804
|
+
<dt>a</dt>
|
805
|
+
<dd>
|
806
|
+
<p id='_'>b</p>
|
807
|
+
</dd>
|
808
|
+
</dl>
|
809
|
+
</table>
|
810
|
+
<table id='_'>
|
811
|
+
<tbody>
|
812
|
+
<tr>
|
813
|
+
<td valign='top' align='left'>a</td>
|
814
|
+
<td valign='top' align='left'>b</td>
|
815
|
+
<td valign='top' align='left'>c</td>
|
816
|
+
</tr>
|
817
|
+
</tbody>
|
818
|
+
</table>
|
819
|
+
<dl id='_'>
|
820
|
+
<dt>a</dt>
|
821
|
+
<dd>
|
822
|
+
<p id='_'>b</p>
|
823
|
+
</dd>
|
824
|
+
</dl>
|
825
|
+
</sections>
|
826
|
+
</standard-document>
|
825
827
|
OUTPUT
|
826
828
|
end
|
827
829
|
|
828
830
|
it "processes headerrows attribute for table without header rows" do
|
829
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
831
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
830
832
|
#{ASCIIDOC_BLANK_HDR}
|
831
833
|
[headerrows=3]
|
832
834
|
|===
|
@@ -836,36 +838,36 @@ OUTPUT
|
|
836
838
|
|a |b |c
|
837
839
|
|===
|
838
840
|
INPUT
|
839
|
-
|
840
|
-
|
841
|
-
|
842
|
-
|
843
|
-
|
844
|
-
|
845
|
-
|
846
|
-
|
847
|
-
|
848
|
-
|
849
|
-
|
850
|
-
|
851
|
-
|
852
|
-
|
853
|
-
|
854
|
-
|
855
|
-
|
856
|
-
|
857
|
-
|
858
|
-
|
859
|
-
|
860
|
-
|
861
|
-
|
862
|
-
|
863
|
-
|
841
|
+
#{BLANK_HDR}
|
842
|
+
<sections>
|
843
|
+
<table id="_"><thead><tr>
|
844
|
+
<th valign="top" align="left">a</th>
|
845
|
+
<th valign="top" align="left">b</th>
|
846
|
+
<th valign="top" align="left">c</th>
|
847
|
+
</tr><tr>
|
848
|
+
<th valign="top" align="left">a</th>
|
849
|
+
<th valign="top" align="left">b</th>
|
850
|
+
<th valign="top" align="left">c</th>
|
851
|
+
</tr><tr>
|
852
|
+
<th valign="top" align="left">a</th>
|
853
|
+
<th valign="top" align="left">b</th>
|
854
|
+
<th valign="top" align="left">c</th>
|
855
|
+
</tr></thead>
|
856
|
+
<tbody>
|
857
|
+
<tr>
|
858
|
+
<td valign="top" align="left">a</td>
|
859
|
+
<td valign="top" align="left">b</td>
|
860
|
+
<td valign="top" align="left">c</td>
|
861
|
+
</tr>
|
862
|
+
</tbody>
|
863
|
+
</table>
|
864
|
+
</sections>
|
865
|
+
</standard-document>
|
864
866
|
OUTPUT
|
865
867
|
end
|
866
868
|
|
867
869
|
it "processes headerrows attribute for table with header rows" do
|
868
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
870
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
869
871
|
#{ASCIIDOC_BLANK_HDR}
|
870
872
|
[headerrows=3]
|
871
873
|
|===
|
@@ -876,41 +878,41 @@ OUTPUT
|
|
876
878
|
|a |b |c
|
877
879
|
|===
|
878
880
|
INPUT
|
879
|
-
|
880
|
-
|
881
|
-
|
882
|
-
|
883
|
-
|
884
|
-
|
885
|
-
|
886
|
-
|
887
|
-
|
888
|
-
|
889
|
-
|
890
|
-
|
891
|
-
|
892
|
-
|
893
|
-
|
894
|
-
|
895
|
-
|
896
|
-
|
897
|
-
|
898
|
-
|
899
|
-
|
900
|
-
|
901
|
-
|
902
|
-
|
903
|
-
|
904
|
-
|
905
|
-
|
906
|
-
|
907
|
-
|
908
|
-
|
881
|
+
#{BLANK_HDR}
|
882
|
+
<sections>
|
883
|
+
<table id="_">
|
884
|
+
<thead>
|
885
|
+
<tr>
|
886
|
+
<th valign="top" align="left">a</th>
|
887
|
+
<th valign="top" align="left">b</th>
|
888
|
+
<th valign="top" align="left">c</th>
|
889
|
+
</tr>
|
890
|
+
<tr>
|
891
|
+
<th valign="top" align="left">a</th>
|
892
|
+
<th valign="top" align="left">b</th>
|
893
|
+
<th valign="top" align="left">c</th>
|
894
|
+
</tr><tr>
|
895
|
+
<th valign="top" align="left">a</th>
|
896
|
+
<th valign="top" align="left">b</th>
|
897
|
+
<th valign="top" align="left">c</th>
|
898
|
+
</tr></thead>
|
899
|
+
<tbody>
|
900
|
+
|
901
|
+
|
902
|
+
<tr>
|
903
|
+
<td valign="top" align="left">a</td>
|
904
|
+
<td valign="top" align="left">b</td>
|
905
|
+
<td valign="top" align="left">c</td>
|
906
|
+
</tr>
|
907
|
+
</tbody>
|
908
|
+
</table>
|
909
|
+
</sections>
|
910
|
+
</standard-document>
|
909
911
|
OUTPUT
|
910
912
|
end
|
911
913
|
|
912
914
|
it "moves table notes inside table" do
|
913
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
915
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
914
916
|
#{ASCIIDOC_BLANK_HDR}
|
915
917
|
|===
|
916
918
|
|a |b |c
|
@@ -920,28 +922,28 @@ OUTPUT
|
|
920
922
|
|
921
923
|
NOTE: Note 2
|
922
924
|
INPUT
|
923
|
-
|
924
|
-
|
925
|
-
|
926
|
-
|
927
|
-
|
928
|
-
|
929
|
-
|
930
|
-
|
931
|
-
|
932
|
-
|
933
|
-
|
934
|
-
|
935
|
-
|
936
|
-
|
937
|
-
|
938
|
-
|
939
|
-
|
925
|
+
#{BLANK_HDR}
|
926
|
+
<sections><table id="_">
|
927
|
+
<tbody>
|
928
|
+
<tr>
|
929
|
+
<td valign="top" align="left">a</td>
|
930
|
+
<td valign="top" align="left">b</td>
|
931
|
+
<td valign="top" align="left">c</td>
|
932
|
+
</tr>
|
933
|
+
</tbody>
|
934
|
+
<note id="_">
|
935
|
+
<p id="_">Note 1</p>
|
936
|
+
</note><note id="_">
|
937
|
+
<p id="_">Note 2</p>
|
938
|
+
</note></table>
|
939
|
+
|
940
|
+
</sections>
|
941
|
+
</standard-document>
|
940
942
|
OUTPUT
|
941
943
|
end
|
942
944
|
|
943
945
|
it "moves formula key inside formula" do
|
944
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
946
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
945
947
|
#{ASCIIDOC_BLANK_HDR}
|
946
948
|
[stem]
|
947
949
|
++++
|
@@ -967,66 +969,66 @@ OUTPUT
|
|
967
969
|
|
968
970
|
a:: b
|
969
971
|
INPUT
|
970
|
-
|
971
|
-
|
972
|
-
|
973
|
-
|
974
|
-
|
975
|
-
|
976
|
-
|
977
|
-
|
978
|
-
|
979
|
-
|
980
|
-
|
981
|
-
|
982
|
-
|
983
|
-
|
984
|
-
|
985
|
-
|
986
|
-
|
987
|
-
|
988
|
-
|
989
|
-
|
990
|
-
|
991
|
-
|
992
|
-
|
993
|
-
|
994
|
-
|
995
|
-
|
996
|
-
|
997
|
-
|
998
|
-
|
999
|
-
|
1000
|
-
|
1001
|
-
|
1002
|
-
|
1003
|
-
|
1004
|
-
|
1005
|
-
|
1006
|
-
|
1007
|
-
|
1008
|
-
|
1009
|
-
|
1010
|
-
|
1011
|
-
|
1012
|
-
|
1013
|
-
|
1014
|
-
|
1015
|
-
|
1016
|
-
|
1017
|
-
|
1018
|
-
|
1019
|
-
|
1020
|
-
|
1021
|
-
|
1022
|
-
|
1023
|
-
|
1024
|
-
|
972
|
+
#{BLANK_HDR}
|
973
|
+
<sections>
|
974
|
+
<formula id='_'>
|
975
|
+
<stem type='MathML'>
|
976
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
977
|
+
<mi>F</mi>
|
978
|
+
<mi>or</mi>
|
979
|
+
<mi>μ</mi>
|
980
|
+
<mi>l</mi>
|
981
|
+
<mi>a</mi>
|
982
|
+
</math>
|
983
|
+
</stem>
|
984
|
+
<dl id='_' key='true'>
|
985
|
+
<dt>a</dt>
|
986
|
+
<dd>
|
987
|
+
<p id='_'>b</p>
|
988
|
+
</dd>
|
989
|
+
</dl>
|
990
|
+
</formula>
|
991
|
+
<formula id='_'>
|
992
|
+
<stem type='MathML'>
|
993
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
994
|
+
<mi>F</mi>
|
995
|
+
<mi>or</mi>
|
996
|
+
<mi>μ</mi>
|
997
|
+
<mi>l</mi>
|
998
|
+
<mi>a</mi>
|
999
|
+
</math>
|
1000
|
+
</stem>
|
1001
|
+
<dl id='_' key='true'>
|
1002
|
+
<dt>a</dt>
|
1003
|
+
<dd>
|
1004
|
+
<p id='_'>b</p>
|
1005
|
+
</dd>
|
1006
|
+
</dl>
|
1007
|
+
</formula>
|
1008
|
+
<formula id='_'>
|
1009
|
+
<stem type='MathML'>
|
1010
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
1011
|
+
<mi>F</mi>
|
1012
|
+
<mi>or</mi>
|
1013
|
+
<mi>μ</mi>
|
1014
|
+
<mi>l</mi>
|
1015
|
+
<mi>a</mi>
|
1016
|
+
</math>
|
1017
|
+
</stem>
|
1018
|
+
</formula>
|
1019
|
+
<dl id='_'>
|
1020
|
+
<dt>a</dt>
|
1021
|
+
<dd>
|
1022
|
+
<p id='_'>b</p>
|
1023
|
+
</dd>
|
1024
|
+
</dl>
|
1025
|
+
</sections>
|
1026
|
+
</standard-document>
|
1025
1027
|
OUTPUT
|
1026
1028
|
end
|
1027
1029
|
|
1028
1030
|
it "moves footnotes inside figures" do
|
1029
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
1031
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
1030
1032
|
#{ASCIIDOC_BLANK_HDR}
|
1031
1033
|
.Figuretitle.footnote:[xyz]
|
1032
1034
|
image::spec/examples/rice_images/rice_image1.png[]
|
@@ -1037,35 +1039,33 @@ OUTPUT
|
|
1037
1039
|
|
1038
1040
|
A footnote:[This is a third footnote]
|
1039
1041
|
INPUT
|
1040
|
-
|
1041
|
-
|
1042
|
-
|
1043
|
-
|
1044
|
-
|
1045
|
-
|
1046
|
-
|
1047
|
-
</name>
|
1048
|
-
|
1049
|
-
|
1050
|
-
|
1051
|
-
|
1052
|
-
|
1053
|
-
|
1054
|
-
|
1055
|
-
|
1056
|
-
|
1057
|
-
|
1058
|
-
|
1059
|
-
</p>
|
1060
|
-
|
1061
|
-
|
1062
|
-
|
1063
|
-
</standard-document>
|
1042
|
+
#{BLANK_HDR}
|
1043
|
+
<sections><figure id="_">
|
1044
|
+
<name>
|
1045
|
+
Figuretitle.
|
1046
|
+
<fn reference='1'>
|
1047
|
+
<p id='_'>xyz</p>
|
1048
|
+
</fn>
|
1049
|
+
</name>
|
1050
|
+
<image src="spec/examples/rice_images/rice_image1.png" id="_" mimetype="image/png" height="auto" width="auto"/>
|
1051
|
+
<fn reference="a">
|
1052
|
+
<p id="_">This is a footnote to a figure</p>
|
1053
|
+
</fn><fn reference="b">
|
1054
|
+
<p id="_">This is another footnote to a figure</p>
|
1055
|
+
</fn></figure>
|
1056
|
+
<p id='_'>
|
1057
|
+
A
|
1058
|
+
<fn reference='2'>
|
1059
|
+
<p id='_'>This is a third footnote</p>
|
1060
|
+
</fn>
|
1061
|
+
</p>
|
1062
|
+
</sections>
|
1063
|
+
</standard-document>
|
1064
1064
|
OUTPUT
|
1065
1065
|
end
|
1066
1066
|
|
1067
1067
|
it "moves figure key inside figure" do
|
1068
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
1068
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
1069
1069
|
#{ASCIIDOC_BLANK_HDR}
|
1070
1070
|
image::spec/examples/rice_images/rice_image1.png[]
|
1071
1071
|
|
@@ -1082,42 +1082,42 @@ OUTPUT
|
|
1082
1082
|
|
1083
1083
|
a:: b
|
1084
1084
|
INPUT
|
1085
|
-
|
1086
|
-
|
1087
|
-
|
1088
|
-
|
1089
|
-
|
1090
|
-
|
1091
|
-
|
1092
|
-
|
1093
|
-
|
1094
|
-
|
1095
|
-
|
1096
|
-
|
1097
|
-
|
1098
|
-
|
1099
|
-
|
1100
|
-
|
1101
|
-
|
1102
|
-
|
1103
|
-
|
1104
|
-
|
1105
|
-
|
1106
|
-
|
1107
|
-
|
1108
|
-
|
1109
|
-
|
1110
|
-
|
1111
|
-
|
1112
|
-
|
1113
|
-
|
1114
|
-
|
1115
|
-
|
1085
|
+
#{BLANK_HDR}
|
1086
|
+
<sections>
|
1087
|
+
<figure id='_'>
|
1088
|
+
<image src='spec/examples/rice_images/rice_image1.png' id='_' mimetype='image/png' height='auto' width='auto'/>
|
1089
|
+
<dl id='_' key='true'>
|
1090
|
+
<dt>a</dt>
|
1091
|
+
<dd>
|
1092
|
+
<p id='_'>b</p>
|
1093
|
+
</dd>
|
1094
|
+
</dl>
|
1095
|
+
</figure>
|
1096
|
+
<figure id='_'>
|
1097
|
+
<image src='spec/examples/rice_images/rice_image1.png' id='_' mimetype='image/png' height='auto' width='auto'/>
|
1098
|
+
<dl id='_' key='true'>
|
1099
|
+
<dt>a</dt>
|
1100
|
+
<dd>
|
1101
|
+
<p id='_'>b</p>
|
1102
|
+
</dd>
|
1103
|
+
</dl>
|
1104
|
+
</figure>
|
1105
|
+
<figure id='_'>
|
1106
|
+
<image src='spec/examples/rice_images/rice_image1.png' id='_' mimetype='image/png' height='auto' width='auto'/>
|
1107
|
+
</figure>
|
1108
|
+
<dl id='_'>
|
1109
|
+
<dt>a</dt>
|
1110
|
+
<dd>
|
1111
|
+
<p id='_'>b</p>
|
1112
|
+
</dd>
|
1113
|
+
</dl>
|
1114
|
+
</sections>
|
1115
|
+
</standard-document>
|
1116
1116
|
OUTPUT
|
1117
1117
|
end
|
1118
1118
|
|
1119
1119
|
it "processes subfigures" do
|
1120
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
1120
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
1121
1121
|
#{ASCIIDOC_BLANK_HDR}
|
1122
1122
|
[[figureC-2]]
|
1123
1123
|
.Stages of gelatinization
|
@@ -1132,27 +1132,27 @@ OUTPUT
|
|
1132
1132
|
image::spec/examples/rice_images/rice_image3_3.png[]
|
1133
1133
|
====
|
1134
1134
|
INPUT
|
1135
|
-
|
1136
|
-
|
1137
|
-
|
1138
|
-
|
1139
|
-
|
1140
|
-
|
1141
|
-
|
1142
|
-
|
1143
|
-
|
1144
|
-
|
1145
|
-
|
1146
|
-
|
1147
|
-
|
1148
|
-
|
1149
|
-
|
1150
|
-
|
1135
|
+
#{BLANK_HDR}
|
1136
|
+
<sections>
|
1137
|
+
<figure id="figureC-2"><name>Stages of gelatinization</name><figure id="_">
|
1138
|
+
<name>Initial stages: No grains are fully gelatinized (ungelatinized starch granules are visible inside the kernels)</name>
|
1139
|
+
<image src="spec/examples/rice_images/rice_image3_1.png" id="_" mimetype="image/png" height="auto" width="auto"/>
|
1140
|
+
</figure>
|
1141
|
+
<figure id="_">
|
1142
|
+
<name>Intermediate stages: Some fully gelatinized kernels are visible</name>
|
1143
|
+
<image src="spec/examples/rice_images/rice_image3_2.png" id="_" mimetype="image/png" height="auto" width="auto"/>
|
1144
|
+
</figure>
|
1145
|
+
<figure id="_">
|
1146
|
+
<name>Final stages: All kernels are fully gelatinized</name>
|
1147
|
+
<image src="spec/examples/rice_images/rice_image3_3.png" id="_" mimetype="image/png" height="auto" width="auto"/>
|
1148
|
+
</figure></figure>
|
1149
|
+
</sections>
|
1150
|
+
</standard-document>
|
1151
1151
|
OUTPUT
|
1152
1152
|
end
|
1153
1153
|
|
1154
1154
|
it "numbers bibliographic notes and footnotes sequentially" do
|
1155
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
1155
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
1156
1156
|
#{ASCIIDOC_BLANK_HDR}
|
1157
1157
|
footnote:[Footnote]
|
1158
1158
|
|
@@ -1203,8 +1203,8 @@ OUTPUT
|
|
1203
1203
|
OUTPUT
|
1204
1204
|
end
|
1205
1205
|
|
1206
|
-
|
1207
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
1206
|
+
it "rearranges term note, term example, term source" do
|
1207
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
1208
1208
|
#{ASCIIDOC_BLANK_HDR}
|
1209
1209
|
|
1210
1210
|
== Terms and definitions
|
@@ -1224,33 +1224,33 @@ OUTPUT
|
|
1224
1224
|
[example]
|
1225
1225
|
Example 2
|
1226
1226
|
INPUT
|
1227
|
-
|
1228
|
-
|
1229
|
-
|
1230
|
-
|
1231
|
-
|
1232
|
-
|
1233
|
-
|
1234
|
-
|
1235
|
-
|
1236
|
-
|
1237
|
-
|
1238
|
-
|
1239
|
-
|
1240
|
-
|
1241
|
-
|
1242
|
-
|
1243
|
-
|
1244
|
-
|
1245
|
-
|
1246
|
-
|
1247
|
-
|
1248
|
-
|
1249
|
-
|
1250
|
-
|
1251
|
-
|
1252
|
-
|
1253
|
-
|
1227
|
+
#{BLANK_HDR}
|
1228
|
+
<sections>
|
1229
|
+
<terms id="_" obligation="normative">
|
1230
|
+
<title>Terms and definitions</title>
|
1231
|
+
<p id="_">For the purposes of this document, the following terms and definitions apply.</p>
|
1232
|
+
<term id="term-term"><preferred>Term</preferred>
|
1233
|
+
|
1234
|
+
|
1235
|
+
|
1236
|
+
<termnote id="_">
|
1237
|
+
<p id="_">Note</p>
|
1238
|
+
</termnote><termnote id="_">
|
1239
|
+
<p id="_">Note 2</p>
|
1240
|
+
</termnote><termexample id="_">
|
1241
|
+
<p id="_">Example 1</p>
|
1242
|
+
</termexample><termexample id="_">
|
1243
|
+
<p id="_">Example 2</p>
|
1244
|
+
</termexample><termsource status="identical">
|
1245
|
+
<origin bibitemid="ISO2191" type="inline" citeas="">
|
1246
|
+
<localityStack>
|
1247
|
+
<locality type="section"><referenceFrom>1</referenceFrom></locality>
|
1248
|
+
</localityStack>
|
1249
|
+
</origin>
|
1250
|
+
</termsource></term>
|
1251
|
+
</terms>
|
1252
|
+
</sections>
|
1253
|
+
</standard-document>
|
1254
1254
|
OUTPUT
|
1255
1255
|
end
|
1256
1256
|
|
@@ -1265,148 +1265,147 @@ OUTPUT
|
|
1265
1265
|
# mock_iecbib_get_iec60050_103_01
|
1266
1266
|
# mock_iev
|
1267
1267
|
VCR.use_cassette "separates_iev_citations_by_top_level_clause" do
|
1268
|
-
|
1269
|
-
|
1268
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
1269
|
+
#{CACHED_ISOBIB_BLANK_HDR}
|
1270
1270
|
|
1271
|
-
|
1272
|
-
|
1273
|
-
|
1271
|
+
[bibliography]
|
1272
|
+
== Normative References
|
1273
|
+
* [[[iev,IEV]]], _iev_
|
1274
1274
|
|
1275
|
-
|
1276
|
-
|
1275
|
+
== Terms and definitions
|
1276
|
+
=== Automation1
|
1277
1277
|
|
1278
|
-
|
1279
|
-
|
1278
|
+
[.source]
|
1279
|
+
<<iev,clause="103-01-02">>
|
1280
1280
|
|
1281
|
-
|
1281
|
+
=== Automation2
|
1282
1282
|
|
1283
|
-
|
1284
|
-
|
1283
|
+
[.source]
|
1284
|
+
<<iev,clause="102-01-02">>
|
1285
1285
|
|
1286
|
-
|
1286
|
+
=== Automation3
|
1287
1287
|
|
1288
|
-
|
1289
|
-
|
1288
|
+
[.source]
|
1289
|
+
<<iev,clause="103-01-02">>
|
1290
1290
|
INPUT
|
1291
|
-
|
1292
|
-
|
1293
|
-
|
1294
|
-
|
1295
|
-
|
1296
|
-
|
1297
|
-
|
1298
|
-
|
1299
|
-
|
1300
|
-
|
1301
|
-
|
1302
|
-
|
1303
|
-
|
1304
|
-
|
1305
|
-
|
1306
|
-
|
1307
|
-
|
1308
|
-
|
1309
|
-
|
1310
|
-
|
1311
|
-
|
1312
|
-
|
1313
|
-
|
1314
|
-
|
1315
|
-
|
1316
|
-
|
1317
|
-
|
1318
|
-
|
1319
|
-
|
1320
|
-
|
1321
|
-
|
1322
|
-
|
1323
|
-
|
1324
|
-
|
1325
|
-
|
1326
|
-
|
1327
|
-
|
1328
|
-
|
1329
|
-
|
1330
|
-
|
1331
|
-
|
1332
|
-
|
1333
|
-
|
1334
|
-
|
1335
|
-
|
1336
|
-
|
1337
|
-
|
1338
|
-
|
1339
|
-
|
1340
|
-
|
1341
|
-
|
1342
|
-
|
1343
|
-
|
1344
|
-
|
1345
|
-
|
1346
|
-
|
1347
|
-
|
1348
|
-
|
1349
|
-
|
1350
|
-
|
1351
|
-
|
1352
|
-
|
1353
|
-
|
1354
|
-
|
1355
|
-
|
1356
|
-
|
1357
|
-
|
1358
|
-
|
1359
|
-
|
1360
|
-
|
1361
|
-
|
1362
|
-
|
1363
|
-
|
1364
|
-
|
1365
|
-
|
1366
|
-
|
1367
|
-
|
1368
|
-
|
1369
|
-
|
1370
|
-
|
1371
|
-
|
1372
|
-
|
1373
|
-
|
1374
|
-
|
1375
|
-
|
1376
|
-
|
1377
|
-
|
1378
|
-
|
1379
|
-
|
1380
|
-
|
1381
|
-
|
1382
|
-
|
1383
|
-
<
|
1384
|
-
|
1385
|
-
|
1386
|
-
|
1387
|
-
|
1388
|
-
|
1389
|
-
|
1390
|
-
|
1391
|
-
|
1392
|
-
|
1393
|
-
|
1394
|
-
|
1395
|
-
|
1396
|
-
|
1397
|
-
|
1398
|
-
|
1399
|
-
|
1400
|
-
<
|
1401
|
-
|
1402
|
-
|
1403
|
-
|
1404
|
-
|
1405
|
-
|
1406
|
-
|
1407
|
-
|
1408
|
-
|
1409
|
-
OUTPUT
|
1291
|
+
#{BLANK_HDR}
|
1292
|
+
<sections>
|
1293
|
+
<terms id="_" obligation="normative"><title>Terms and definitions</title>
|
1294
|
+
<p id="_">For the purposes of this document, the following terms and definitions apply.</p>
|
1295
|
+
<term id="term-automation1">
|
1296
|
+
<preferred>Automation1</preferred>
|
1297
|
+
<termsource status="identical">
|
1298
|
+
<origin bibitemid="IEC60050-103" type="inline" citeas="IEC 60050-103:2009">
|
1299
|
+
<localityStack>
|
1300
|
+
<locality type="clause"><referenceFrom>103-01-02</referenceFrom></locality>
|
1301
|
+
</localityStack>
|
1302
|
+
</origin>
|
1303
|
+
</termsource>
|
1304
|
+
</term>
|
1305
|
+
<term id="term-automation2">
|
1306
|
+
<preferred>Automation2</preferred>
|
1307
|
+
<termsource status="identical">
|
1308
|
+
<origin bibitemid="IEC60050-102" type="inline" citeas="IEC 60050-102:2007">
|
1309
|
+
<localityStack>
|
1310
|
+
<locality type="clause"><referenceFrom>102-01-02</referenceFrom></locality>
|
1311
|
+
</localityStack>
|
1312
|
+
</origin>
|
1313
|
+
</termsource>
|
1314
|
+
</term>
|
1315
|
+
<term id="term-automation3">
|
1316
|
+
<preferred>Automation3</preferred>
|
1317
|
+
<termsource status="identical">
|
1318
|
+
<origin bibitemid="IEC60050-103" type="inline" citeas="IEC 60050-103:2009">
|
1319
|
+
<localityStack>
|
1320
|
+
<locality type="clause"><referenceFrom>103-01-02</referenceFrom></locality>
|
1321
|
+
</localityStack>
|
1322
|
+
</origin>
|
1323
|
+
</termsource>
|
1324
|
+
</term></terms></sections><bibliography><references id="_" obligation="informative" normative="true">
|
1325
|
+
<title>Normative references</title>
|
1326
|
+
#{NORM_REF_BOILERPLATE}
|
1327
|
+
<bibitem type="standard" id="IEC60050-102">
|
1328
|
+
<fetched>#{Date.today}</fetched>
|
1329
|
+
<title type="title-main" format="text/plain" language="en" script="Latn">International Electrotechnical Vocabulary (IEV)</title>
|
1330
|
+
<title type="title-part" format="text/plain" language="en" script="Latn">Part 102: Mathematics — General concepts and linear algebra</title>
|
1331
|
+
<title type='main' format='text/plain' language='en' script='Latn'>International Electrotechnical Vocabulary (IEV) — Part 102: Mathematics — General concepts and linear algebra</title>
|
1332
|
+
<uri type="src">https://webstore.iec.ch/publication/160</uri>
|
1333
|
+
<uri type="obp">/preview/info_iec60050-102%7Bed1.0%7Db.pdf</uri>
|
1334
|
+
<docidentifier type="IEC">IEC 60050-102:2007</docidentifier>
|
1335
|
+
<docidentifier type='URN'>urn:iec:std:iec:60050-102:2007:::en</docidentifier>
|
1336
|
+
<date type="published">
|
1337
|
+
<on>2007-08-27</on>
|
1338
|
+
</date>
|
1339
|
+
<contributor>
|
1340
|
+
<role type="publisher"/>
|
1341
|
+
<organization>
|
1342
|
+
<name>International Electrotechnical Commission</name>
|
1343
|
+
<abbreviation>IEC</abbreviation>
|
1344
|
+
<uri>www.iec.ch</uri>
|
1345
|
+
</organization>
|
1346
|
+
</contributor>
|
1347
|
+
<edition>1.0</edition>
|
1348
|
+
<language>en</language>
|
1349
|
+
<script>Latn</script>
|
1350
|
+
<abstract format="text/plain" language="en" script="Latn">This part of IEC 60050 gives the general mathematical terminology used in the fields of electricity, electronics and telecommunications, together with basic concepts in linear algebra. It maintains a clear distinction between mathematical concepts and physical concepts, even if some terms are used in both cases. Another part will deal with functions. It has the status of a horizontal standard in accordance with IEC Guide 108.</abstract>
|
1351
|
+
<status>
|
1352
|
+
<stage>60</stage>
|
1353
|
+
<substage>60</substage>
|
1354
|
+
</status>
|
1355
|
+
<copyright>
|
1356
|
+
<from>2007</from>
|
1357
|
+
<owner>
|
1358
|
+
<organization>
|
1359
|
+
<name>International Electrotechnical Commission</name>
|
1360
|
+
<abbreviation>IEC</abbreviation>
|
1361
|
+
<uri>www.iec.ch</uri>
|
1362
|
+
</organization>
|
1363
|
+
</owner>
|
1364
|
+
</copyright>
|
1365
|
+
<place>Geneva</place>
|
1366
|
+
</bibitem><bibitem type="standard" id="IEC60050-103">
|
1367
|
+
<fetched>#{Date.today}</fetched>
|
1368
|
+
<title type="title-main" format="text/plain" language="en" script="Latn">International Electrotechnical Vocabulary (IEV)</title>
|
1369
|
+
<title type="title-part" format="text/plain" language="en" script="Latn">Part 103: Mathematics — Functions</title>
|
1370
|
+
<title type="main" format="text/plain" language="en" script="Latn">International Electrotechnical Vocabulary (IEV) — Part 103: Mathematics — Functions</title>
|
1371
|
+
<uri type="src">https://webstore.iec.ch/publication/161</uri>
|
1372
|
+
<uri type="obp">/preview/info_iec60050-103%7Bed1.0%7Db.pdf</uri>
|
1373
|
+
<docidentifier type="IEC">IEC 60050-103:2009</docidentifier>
|
1374
|
+
<docidentifier type='URN'>urn:iec:std:iec:60050-103:2009:::en</docidentifier>
|
1375
|
+
<date type="published">
|
1376
|
+
<on>2009-12-14</on>
|
1377
|
+
</date>
|
1378
|
+
<contributor>
|
1379
|
+
<role type="publisher"/>
|
1380
|
+
<organization>
|
1381
|
+
<name>International Electrotechnical Commission</name>
|
1382
|
+
<abbreviation>IEC</abbreviation>
|
1383
|
+
<uri>www.iec.ch</uri>
|
1384
|
+
</organization>
|
1385
|
+
</contributor>
|
1386
|
+
<edition>1.0</edition>
|
1387
|
+
<language>en</language>
|
1388
|
+
<script>Latn</script>
|
1389
|
+
<abstract format="text/plain" language="en" script="Latn">IEC 60050-103:2009 gives the terminology relative to functions of one or more variables. Together with IEC 60050-102, it covers the mathematical terminology used in the fields of electricity, electronics and telecommunications. It maintains a clear distinction between mathematical concepts and physical concepts, even if some terms are used in both cases. Mathematical symbols are generally in accordance with IEC 60027-1 and ISO 80000-2. This standard cancels and replaces Sections 101-13, 101-14 and 101-15 of International Standard IEC 60050-101:1998. It has the status of a horizontal standard in accordance with IEC Guide 108.</abstract>
|
1390
|
+
<status>
|
1391
|
+
<stage>60</stage>
|
1392
|
+
<substage>60</substage>
|
1393
|
+
</status>
|
1394
|
+
<copyright>
|
1395
|
+
<from>2009</from>
|
1396
|
+
<owner>
|
1397
|
+
<organization>
|
1398
|
+
<name>International Electrotechnical Commission</name>
|
1399
|
+
<abbreviation>IEC</abbreviation>
|
1400
|
+
<uri>www.iec.ch</uri>
|
1401
|
+
</organization>
|
1402
|
+
</owner>
|
1403
|
+
</copyright>
|
1404
|
+
<place>Geneva</place>
|
1405
|
+
</bibitem>
|
1406
|
+
</references></bibliography>
|
1407
|
+
</standard-document>
|
1408
|
+
OUTPUT
|
1410
1409
|
end
|
1411
1410
|
FileUtils.rm_rf File.expand_path("~/.iev.pstore")
|
1412
1411
|
FileUtils.mv File.expand_path("~/.iev.pstore1"), File.expand_path("~/.iev.pstore"), force: true
|
@@ -1414,43 +1413,41 @@ OUTPUT
|
|
1414
1413
|
FileUtils.mv File.expand_path("~/.relaton-bib.pstore1"), File.expand_path("~/.relaton/cache"), force: true
|
1415
1414
|
end
|
1416
1415
|
|
1417
|
-
|
1418
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
1419
|
-
|
1420
|
-
|
1421
|
-
|
1416
|
+
it "counts footnotes with link-only content as separate footnotes" do
|
1417
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
1418
|
+
#{ASCIIDOC_BLANK_HDR}
|
1419
|
+
|
1420
|
+
footnote:[http://www.example.com]
|
1422
1421
|
|
1423
|
-
|
1422
|
+
footnote:[http://www.example.com]
|
1424
1423
|
|
1425
|
-
|
1424
|
+
footnote:[http://www.example1.com]
|
1426
1425
|
INPUT
|
1427
|
-
|
1428
|
-
|
1429
|
-
|
1430
|
-
|
1431
|
-
|
1432
|
-
</fn>
|
1433
|
-
</p>
|
1434
|
-
<p id="_"><fn reference="1">
|
1435
|
-
|
1436
|
-
|
1437
|
-
|
1438
|
-
</fn>
|
1439
|
-
</p>
|
1440
|
-
<p id="_"><fn reference="2">
|
1441
|
-
|
1442
|
-
|
1443
|
-
|
1444
|
-
</fn>
|
1445
|
-
</p></sections>
|
1446
|
-
|
1447
|
-
|
1448
|
-
</standard-document>
|
1426
|
+
#{BLANK_HDR}
|
1427
|
+
<sections><p id="_"><fn reference="1">
|
1428
|
+
<p id="_">
|
1429
|
+
<link target="http://www.example.com"/>
|
1430
|
+
</p>
|
1431
|
+
</fn>
|
1432
|
+
</p>
|
1433
|
+
<p id="_"><fn reference="1">
|
1434
|
+
<p id="_">
|
1435
|
+
<link target="http://www.example.com"/>
|
1436
|
+
</p>
|
1437
|
+
</fn>
|
1438
|
+
</p>
|
1439
|
+
<p id="_"><fn reference="2">
|
1440
|
+
<p id="_">
|
1441
|
+
<link target="http://www.example1.com"/>
|
1442
|
+
</p>
|
1443
|
+
</fn>
|
1444
|
+
</p></sections>
|
1445
|
+
</standard-document>
|
1449
1446
|
OUTPUT
|
1450
1447
|
end
|
1451
1448
|
|
1452
|
-
|
1453
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
1449
|
+
it "retains AsciiMath on request" do
|
1450
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
1454
1451
|
= Document title
|
1455
1452
|
Author
|
1456
1453
|
:docfile: test.adoc
|
@@ -1461,19 +1458,18 @@ OUTPUT
|
|
1461
1458
|
|
1462
1459
|
stem:[1/r]
|
1463
1460
|
INPUT
|
1464
|
-
|
1465
|
-
|
1466
|
-
|
1467
|
-
|
1468
|
-
</p>
|
1469
|
-
</sections>
|
1470
|
-
</standard-document>
|
1471
|
-
|
1461
|
+
#{BLANK_HDR}
|
1462
|
+
<sections>
|
1463
|
+
<p id="_">
|
1464
|
+
<stem type="AsciiMath">1/r</stem>
|
1465
|
+
</p>
|
1466
|
+
</sections>
|
1467
|
+
</standard-document>
|
1472
1468
|
OUTPUT
|
1473
1469
|
end
|
1474
1470
|
|
1475
1471
|
it "converts AsciiMath to MathML by default" do
|
1476
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
1472
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
1477
1473
|
= Document title
|
1478
1474
|
Author
|
1479
1475
|
:docfile: test.adoc
|
@@ -1483,43 +1479,41 @@ OUTPUT
|
|
1483
1479
|
|
1484
1480
|
stem:[1/r]
|
1485
1481
|
INPUT
|
1486
|
-
|
1487
|
-
|
1488
|
-
|
1489
|
-
|
1490
|
-
<mrow>
|
1491
|
-
|
1492
|
-
</mrow>
|
1493
|
-
<mrow>
|
1494
|
-
|
1495
|
-
</mrow>
|
1496
|
-
</mfrac></math></stem>
|
1497
|
-
|
1498
|
-
|
1499
|
-
|
1482
|
+
#{BLANK_HDR}
|
1483
|
+
<sections>
|
1484
|
+
<p id="_">
|
1485
|
+
<stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><mfrac>
|
1486
|
+
<mrow>
|
1487
|
+
<mn>1</mn>
|
1488
|
+
</mrow>
|
1489
|
+
<mrow>
|
1490
|
+
<mi>r</mi>
|
1491
|
+
</mrow>
|
1492
|
+
</mfrac></math></stem>
|
1493
|
+
</p>
|
1494
|
+
</sections>
|
1495
|
+
</standard-document>
|
1500
1496
|
OUTPUT
|
1501
1497
|
end
|
1502
1498
|
|
1503
|
-
|
1504
|
-
|
1499
|
+
it "cleans up text MathML" do
|
1500
|
+
expect(Asciidoctor::Standoc::Converter.new(nil, *OPTIONS).cleanup(Nokogiri::XML(<<~"INPUT")).to_xml).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
1505
1501
|
#{BLANK_HDR}
|
1506
1502
|
<sections>
|
1507
1503
|
<stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><mfrac><mn>1</mn><mi>r</mi></mfrac></math></stem>
|
1508
1504
|
</sections>
|
1509
1505
|
</standard-document>
|
1510
1506
|
INPUT
|
1511
|
-
|
1512
|
-
|
1513
|
-
|
1514
|
-
</sections>
|
1515
|
-
|
1516
|
-
|
1517
|
-
</standard-document>
|
1507
|
+
#{BLANK_HDR}
|
1508
|
+
<sections>
|
1509
|
+
<stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><mfrac><mn>1</mn><mi>r</mi></mfrac></math></stem>
|
1510
|
+
</sections>
|
1511
|
+
</standard-document>
|
1518
1512
|
OUTPUT
|
1519
1513
|
end
|
1520
1514
|
|
1521
|
-
|
1522
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
1515
|
+
it "renumbers numeric references in Bibliography sequentially" do
|
1516
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
1523
1517
|
#{ASCIIDOC_BLANK_HDR}
|
1524
1518
|
|
1525
1519
|
== Clause
|
@@ -1532,38 +1526,38 @@ OUTPUT
|
|
1532
1526
|
* [[[iso124,ISO 124]]] _Standard 124_
|
1533
1527
|
* [[[iso123,1]]] _Standard 123_
|
1534
1528
|
INPUT
|
1535
|
-
|
1536
|
-
<sections><clause id="_" inline-header="false" obligation="normative">
|
1537
|
-
|
1538
|
-
|
1539
|
-
<eref type="inline" bibitemid="iso124" citeas="ISO 124"/></p>
|
1540
|
-
</clause>
|
1541
|
-
</sections><bibliography><references id="_" obligation="informative" normative="false">
|
1542
|
-
|
1543
|
-
|
1544
|
-
|
1545
|
-
|
1546
|
-
|
1547
|
-
|
1548
|
-
|
1549
|
-
|
1550
|
-
|
1551
|
-
|
1552
|
-
|
1553
|
-
</bibitem>
|
1554
|
-
|
1555
|
-
|
1556
|
-
|
1557
|
-
|
1558
|
-
|
1559
|
-
</bibitem>
|
1560
|
-
</references></bibliography>
|
1561
|
-
|
1562
|
-
OUTPUT
|
1563
|
-
|
1564
|
-
|
1565
|
-
|
1566
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
1529
|
+
#{BLANK_HDR}
|
1530
|
+
<sections><clause id="_" inline-header="false" obligation="normative">
|
1531
|
+
<title>Clause</title>
|
1532
|
+
<p id="_"><eref type="inline" bibitemid="iso123" citeas="[2]"/>
|
1533
|
+
<eref type="inline" bibitemid="iso124" citeas="ISO 124"/></p>
|
1534
|
+
</clause>
|
1535
|
+
</sections><bibliography><references id="_" obligation="informative" normative="false">
|
1536
|
+
<title>Bibliography</title>
|
1537
|
+
<bibitem id="iso124" type="standard">
|
1538
|
+
<title format="text/plain">Standard 124</title>
|
1539
|
+
<docidentifier>ISO 124</docidentifier>
|
1540
|
+
<docnumber>124</docnumber>
|
1541
|
+
<contributor>
|
1542
|
+
<role type="publisher"/>
|
1543
|
+
<organization>
|
1544
|
+
<name>ISO</name>
|
1545
|
+
</organization>
|
1546
|
+
</contributor>
|
1547
|
+
</bibitem>
|
1548
|
+
<bibitem id="iso123">
|
1549
|
+
<formattedref format="application/x-isodoc+xml">
|
1550
|
+
<em>Standard 123</em>
|
1551
|
+
</formattedref>
|
1552
|
+
<docidentifier type="metanorma">[2]</docidentifier>
|
1553
|
+
</bibitem>
|
1554
|
+
</references></bibliography>
|
1555
|
+
</standard-document>
|
1556
|
+
OUTPUT
|
1557
|
+
end
|
1558
|
+
|
1559
|
+
it "renumbers numeric references in Bibliography subclauses sequentially" do
|
1560
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
1567
1561
|
#{ASCIIDOC_BLANK_HDR}
|
1568
1562
|
|
1569
1563
|
== Clause
|
@@ -1594,818 +1588,811 @@ OUTPUT
|
|
1594
1588
|
* [[[iso128,1]]] _Standard 123_
|
1595
1589
|
|
1596
1590
|
INPUT
|
1597
|
-
|
1598
|
-
|
1599
|
-
|
1600
|
-
|
1601
|
-
|
1602
|
-
|
1603
|
-
|
1604
|
-
|
1605
|
-
|
1606
|
-
|
1607
|
-
|
1608
|
-
|
1609
|
-
|
1610
|
-
|
1611
|
-
|
1612
|
-
|
1613
|
-
|
1614
|
-
|
1615
|
-
|
1616
|
-
|
1617
|
-
|
1618
|
-
|
1619
|
-
|
1620
|
-
|
1621
|
-
|
1622
|
-
|
1623
|
-
|
1624
|
-
|
1625
|
-
|
1626
|
-
|
1627
|
-
|
1628
|
-
|
1629
|
-
|
1630
|
-
|
1631
|
-
|
1632
|
-
|
1633
|
-
|
1634
|
-
|
1635
|
-
|
1636
|
-
|
1637
|
-
|
1638
|
-
|
1639
|
-
|
1640
|
-
|
1641
|
-
|
1642
|
-
|
1643
|
-
|
1644
|
-
|
1645
|
-
|
1646
|
-
|
1647
|
-
|
1648
|
-
|
1649
|
-
|
1650
|
-
|
1651
|
-
|
1652
|
-
|
1653
|
-
|
1654
|
-
|
1655
|
-
|
1656
|
-
|
1657
|
-
|
1658
|
-
|
1659
|
-
|
1660
|
-
|
1661
|
-
|
1662
|
-
|
1663
|
-
|
1664
|
-
|
1665
|
-
|
1666
|
-
|
1667
|
-
|
1668
|
-
OUTPUT
|
1669
|
-
|
1670
|
-
|
1671
|
-
it "removes bibdata bibitem IDs" do
|
1672
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
1673
|
-
|
1674
|
-
|
1675
|
-
|
1676
|
-
|
1677
|
-
|
1678
|
-
|
1679
|
-
|
1680
|
-
|
1681
|
-
|
1682
|
-
|
1591
|
+
#{BLANK_HDR}
|
1592
|
+
<sections><clause id="_" inline-header="false" obligation="normative">
|
1593
|
+
<title>Clause</title>
|
1594
|
+
<p id="_"><eref type="inline" bibitemid="iso123" citeas="[2]"/>
|
1595
|
+
<eref type="inline" bibitemid="iso124" citeas="ISO 124"/>
|
1596
|
+
<eref type="inline" bibitemid="iso125" citeas="ISO 125"/>
|
1597
|
+
<eref type="inline" bibitemid="iso126" citeas="[4]"/></p>
|
1598
|
+
</clause>
|
1599
|
+
</sections><bibliography><clause id="_" obligation="informative"><title>Bibliography</title><references id="_" obligation="informative" normative="false">
|
1600
|
+
<title>Clause 1</title>
|
1601
|
+
<bibitem id="iso124" type="standard">
|
1602
|
+
<title format="text/plain">Standard 124</title>
|
1603
|
+
<docidentifier>ISO 124</docidentifier>
|
1604
|
+
<docnumber>124</docnumber>
|
1605
|
+
<contributor>
|
1606
|
+
<role type="publisher"/>
|
1607
|
+
<organization>
|
1608
|
+
<name>ISO</name>
|
1609
|
+
</organization>
|
1610
|
+
</contributor>
|
1611
|
+
</bibitem>
|
1612
|
+
<bibitem id="iso123">
|
1613
|
+
<formattedref format="application/x-isodoc+xml">
|
1614
|
+
<em>Standard 123</em>
|
1615
|
+
</formattedref>
|
1616
|
+
<docidentifier type="metanorma">[2]</docidentifier>
|
1617
|
+
</bibitem>
|
1618
|
+
</references>
|
1619
|
+
<references id="_" obligation="informative" normative="false">
|
1620
|
+
<bibitem id="iso125" type="standard">
|
1621
|
+
<title format="text/plain">Standard 124</title>
|
1622
|
+
<docidentifier>ISO 125</docidentifier>
|
1623
|
+
<docnumber>125</docnumber>
|
1624
|
+
<contributor>
|
1625
|
+
<role type="publisher"/>
|
1626
|
+
<organization>
|
1627
|
+
<name>ISO</name>
|
1628
|
+
</organization>
|
1629
|
+
</contributor>
|
1630
|
+
</bibitem>
|
1631
|
+
<bibitem id="iso126">
|
1632
|
+
<formattedref format="application/x-isodoc+xml">
|
1633
|
+
<em>Standard 123</em>
|
1634
|
+
</formattedref>
|
1635
|
+
<docidentifier type="metanorma">[4]</docidentifier>
|
1636
|
+
</bibitem>
|
1637
|
+
</references>
|
1638
|
+
</clause>
|
1639
|
+
<clause id='_' obligation='informative'>
|
1640
|
+
<title>Bibliography Redux</title>
|
1641
|
+
<references id='_' normative='false' obligation='informative'>
|
1642
|
+
<title>Clause 1</title>
|
1643
|
+
<bibitem id='iso127' type='standard'>
|
1644
|
+
<title format='text/plain'>Standard 124</title>
|
1645
|
+
<docidentifier>ISO 124</docidentifier>
|
1646
|
+
<docnumber>124</docnumber>
|
1647
|
+
<contributor>
|
1648
|
+
<role type='publisher'/>
|
1649
|
+
<organization>
|
1650
|
+
<name>ISO</name>
|
1651
|
+
</organization>
|
1652
|
+
</contributor>
|
1653
|
+
</bibitem>
|
1654
|
+
<bibitem id='iso128'>
|
1655
|
+
<formattedref format='application/x-isodoc+xml'>
|
1656
|
+
<em>Standard 123</em>
|
1657
|
+
</formattedref>
|
1658
|
+
<docidentifier type='metanorma'>[6]</docidentifier>
|
1659
|
+
</bibitem>
|
1660
|
+
</references></clause></bibliography>
|
1661
|
+
</standard-document>
|
1662
|
+
OUTPUT
|
1663
|
+
end
|
1664
|
+
|
1665
|
+
it "removes bibdata bibitem IDs" do
|
1666
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
1667
|
+
= Document title
|
1668
|
+
Author
|
1669
|
+
:docfile: test.adoc
|
1670
|
+
:nodoc:
|
1671
|
+
:novalid:
|
1672
|
+
:no-isobib:
|
1673
|
+
:translated-from: IEC 60050-102
|
1674
|
+
|
1675
|
+
[bibliography]
|
1676
|
+
== Normative References
|
1683
1677
|
|
1684
1678
|
INPUT
|
1685
|
-
|
1686
|
-
<standard-document xmlns='https://www.metanorma.org/ns/standoc' type="semantic" version="#{Metanorma::Standoc::VERSION}">
|
1687
|
-
|
1688
|
-
|
1689
|
-
|
1690
|
-
|
1691
|
-
|
1692
|
-
|
1693
|
-
|
1694
|
-
|
1695
|
-
|
1696
|
-
|
1697
|
-
|
1698
|
-
|
1699
|
-
|
1700
|
-
|
1701
|
-
|
1702
|
-
|
1703
|
-
|
1704
|
-
|
1705
|
-
|
1706
|
-
|
1707
|
-
|
1708
|
-
|
1709
|
-
|
1710
|
-
|
1711
|
-
|
1712
|
-
|
1713
|
-
|
1714
|
-
</standard-document>
|
1715
|
-
OUTPUT
|
1716
|
-
end
|
1679
|
+
<?xml version='1.0' encoding='UTF-8'?>
|
1680
|
+
<standard-document xmlns='https://www.metanorma.org/ns/standoc' type="semantic" version="#{Metanorma::Standoc::VERSION}">
|
1681
|
+
<bibdata type='standard'>
|
1682
|
+
<title language='en' format='text/plain'>Document title</title>
|
1683
|
+
<language>en</language>
|
1684
|
+
<script>Latn</script>
|
1685
|
+
<status>
|
1686
|
+
<stage>published</stage>
|
1687
|
+
</status>
|
1688
|
+
<copyright>
|
1689
|
+
<from>#{Date.today.year}</from>
|
1690
|
+
</copyright>
|
1691
|
+
<relation type='translatedFrom'>
|
1692
|
+
<bibitem>
|
1693
|
+
<title>--</title>
|
1694
|
+
<docidentifier>IEC 60050-102</docidentifier>
|
1695
|
+
</bibitem>
|
1696
|
+
</relation>
|
1697
|
+
<ext>
|
1698
|
+
<doctype>article</doctype>
|
1699
|
+
</ext>
|
1700
|
+
</bibdata>
|
1701
|
+
<sections> </sections>
|
1702
|
+
<bibliography>
|
1703
|
+
<references id='_' obligation='informative' normative="true">
|
1704
|
+
<title>Normative references</title>
|
1705
|
+
<p id="_">There are no normative references in this document.</p>
|
1706
|
+
</references>
|
1707
|
+
</bibliography>
|
1708
|
+
</standard-document>
|
1709
|
+
OUTPUT
|
1710
|
+
end
|
1717
1711
|
|
1718
|
-
it "imports boilerplate file" do
|
1719
|
-
|
1720
|
-
|
1721
|
-
|
1722
|
-
|
1723
|
-
|
1724
|
-
|
1725
|
-
|
1726
|
-
|
1727
|
-
|
1712
|
+
it "imports boilerplate file" do
|
1713
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
1714
|
+
= Document title
|
1715
|
+
Author
|
1716
|
+
:docfile: test.adoc
|
1717
|
+
:nodoc:
|
1718
|
+
:novalid:
|
1719
|
+
:no-isobib:
|
1720
|
+
:docstage: 10
|
1721
|
+
:boilerplate-authority: spec/assets/boilerplate.xml
|
1728
1722
|
|
1729
|
-
|
1723
|
+
== Clause 1
|
1730
1724
|
|
1731
1725
|
INPUT
|
1732
|
-
|
1733
|
-
|
1734
|
-
|
1735
|
-
|
1736
|
-
|
1737
|
-
|
1738
|
-
|
1739
|
-
|
1740
|
-
|
1741
|
-
|
1742
|
-
|
1743
|
-
|
1744
|
-
|
1745
|
-
|
1746
|
-
|
1747
|
-
|
1748
|
-
|
1749
|
-
|
1750
|
-
|
1751
|
-
|
1752
|
-
|
1753
|
-
|
1754
|
-
|
1755
|
-
</standard-document>
|
1726
|
+
<standard-document xmlns='https://www.metanorma.org/ns/standoc' type="semantic" version="#{Metanorma::Standoc::VERSION}">
|
1727
|
+
<bibdata type='standard'>
|
1728
|
+
<title language='en' format='text/plain'>Document title</title>
|
1729
|
+
<language>en</language>
|
1730
|
+
<script>Latn</script>
|
1731
|
+
<status>
|
1732
|
+
<stage>10</stage>
|
1733
|
+
</status>
|
1734
|
+
<copyright>
|
1735
|
+
<from>#{Date.today.year}</from>
|
1736
|
+
</copyright>
|
1737
|
+
<ext>
|
1738
|
+
<doctype>article</doctype>
|
1739
|
+
</ext>
|
1740
|
+
</bibdata>
|
1741
|
+
<boilerplate>
|
1742
|
+
<text>10</text>
|
1743
|
+
</boilerplate>
|
1744
|
+
<sections>
|
1745
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
1746
|
+
<title>Clause 1</title>
|
1747
|
+
</clause>
|
1748
|
+
</sections>
|
1749
|
+
</standard-document>
|
1756
1750
|
OUTPUT
|
1757
|
-
end
|
1751
|
+
end
|
1758
1752
|
|
1759
|
-
it "sorts symbols lists" do
|
1760
|
-
|
1761
|
-
|
1762
|
-
|
1763
|
-
[[L]]
|
1764
|
-
== Symbols and abbreviated terms
|
1765
|
-
|
1766
|
-
α:: Definition 1
|
1767
|
-
Xa:: Definition 2
|
1768
|
-
x_1_:: Definition 3
|
1769
|
-
x_m_:: Definition 4
|
1770
|
-
x:: Definition 5
|
1771
|
-
stem:[n]:: Definition 6
|
1772
|
-
m:: Definition 7
|
1773
|
-
INPUT
|
1774
|
-
#{BLANK_HDR}
|
1775
|
-
<sections>
|
1776
|
-
<definitions id='L' obligation="normative">
|
1777
|
-
<title>Symbols and abbreviated terms</title>
|
1778
|
-
<dl id='_'>
|
1779
|
-
<dt>m</dt>
|
1780
|
-
<dd>
|
1781
|
-
<p id='_'>Definition 7</p>
|
1782
|
-
</dd>
|
1783
|
-
<dt>
|
1784
|
-
<stem type='MathML'>
|
1785
|
-
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
1786
|
-
<mi>n</mi>
|
1787
|
-
</math>
|
1788
|
-
</stem>
|
1789
|
-
</dt>
|
1790
|
-
<dd>
|
1791
|
-
<p id='_'>Definition 6</p>
|
1792
|
-
</dd>
|
1793
|
-
<dt>x</dt>
|
1794
|
-
<dd>
|
1795
|
-
<p id='_'>Definition 5</p>
|
1796
|
-
</dd>
|
1797
|
-
<dt>x_m_</dt>
|
1798
|
-
<dd>
|
1799
|
-
<p id='_'>Definition 4</p>
|
1800
|
-
</dd>
|
1801
|
-
<dt>x_1_</dt>
|
1802
|
-
<dd>
|
1803
|
-
<p id='_'>Definition 3</p>
|
1804
|
-
</dd>
|
1805
|
-
<dt>Xa</dt>
|
1806
|
-
<dd>
|
1807
|
-
<p id='_'>Definition 2</p>
|
1808
|
-
</dd>
|
1809
|
-
<dt>α</dt>
|
1810
|
-
<dd>
|
1811
|
-
<p id='_'>Definition 1</p>
|
1812
|
-
</dd>
|
1813
|
-
</dl>
|
1814
|
-
</definitions>
|
1815
|
-
</sections>
|
1816
|
-
</standard-document>
|
1817
|
-
OUTPUT
|
1818
|
-
end
|
1753
|
+
it "sorts symbols lists" do
|
1754
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
1755
|
+
#{ASCIIDOC_BLANK_HDR}
|
1819
1756
|
|
1820
|
-
|
1821
|
-
|
1822
|
-
|
1823
|
-
|
1824
|
-
|
1825
|
-
|
1826
|
-
|
1827
|
-
|
1828
|
-
|
1829
|
-
|
1830
|
-
|
1831
|
-
|
1832
|
-
|
1833
|
-
|
1834
|
-
|
1835
|
-
|
1836
|
-
|
1837
|
-
<
|
1838
|
-
<
|
1839
|
-
|
1840
|
-
|
1841
|
-
</dd>
|
1842
|
-
<dt><stem type='MathML'>
|
1843
|
-
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
1844
|
-
<msub>
|
1845
|
-
<mrow>
|
1846
|
-
<mi>x</mi>
|
1847
|
-
</mrow>
|
1848
|
-
<mrow>
|
1849
|
-
<mi>m</mi>
|
1850
|
-
</mrow>
|
1851
|
-
</msub>
|
1852
|
-
</math>
|
1853
|
-
</stem></dt>
|
1854
|
-
<dd>
|
1855
|
-
<p id='_'>Definition 4</p>
|
1856
|
-
</dd>
|
1857
|
-
<dt><stem type='MathML'>
|
1858
|
-
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
1859
|
-
<msub>
|
1860
|
-
<mrow>
|
1861
|
-
<mi>x</mi>
|
1862
|
-
</mrow>
|
1863
|
-
<mrow>
|
1864
|
-
<mn>1</mn>
|
1865
|
-
</mrow>
|
1866
|
-
</msub>
|
1867
|
-
</math>
|
1868
|
-
</stem></dt>
|
1869
|
-
<dd>
|
1870
|
-
<p id='_'>Definition 3</p>
|
1871
|
-
</dd>
|
1872
|
-
<dt>xa</dt>
|
1873
|
-
<dd>
|
1874
|
-
<p id='_'>Definition 2</p>
|
1875
|
-
</dd>
|
1876
|
-
<dt>
|
1757
|
+
[[L]]
|
1758
|
+
== Symbols and abbreviated terms
|
1759
|
+
|
1760
|
+
α:: Definition 1
|
1761
|
+
Xa:: Definition 2
|
1762
|
+
x_1_:: Definition 3
|
1763
|
+
x_m_:: Definition 4
|
1764
|
+
x:: Definition 5
|
1765
|
+
stem:[n]:: Definition 6
|
1766
|
+
m:: Definition 7
|
1767
|
+
INPUT
|
1768
|
+
#{BLANK_HDR}
|
1769
|
+
<sections>
|
1770
|
+
<definitions id='L' obligation="normative">
|
1771
|
+
<title>Symbols and abbreviated terms</title>
|
1772
|
+
<dl id='_'>
|
1773
|
+
<dt>m</dt>
|
1774
|
+
<dd>
|
1775
|
+
<p id='_'>Definition 7</p>
|
1776
|
+
</dd>
|
1777
|
+
<dt>
|
1877
1778
|
<stem type='MathML'>
|
1878
|
-
|
1879
|
-
|
1880
|
-
|
1881
|
-
</stem>
|
1882
|
-
|
1883
|
-
|
1884
|
-
|
1885
|
-
|
1886
|
-
|
1887
|
-
|
1888
|
-
|
1889
|
-
</
|
1890
|
-
|
1891
|
-
|
1779
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
1780
|
+
<mi>n</mi>
|
1781
|
+
</math>
|
1782
|
+
</stem>
|
1783
|
+
</dt>
|
1784
|
+
<dd>
|
1785
|
+
<p id='_'>Definition 6</p>
|
1786
|
+
</dd>
|
1787
|
+
<dt>x</dt>
|
1788
|
+
<dd>
|
1789
|
+
<p id='_'>Definition 5</p>
|
1790
|
+
</dd>
|
1791
|
+
<dt>x_m_</dt>
|
1792
|
+
<dd>
|
1793
|
+
<p id='_'>Definition 4</p>
|
1794
|
+
</dd>
|
1795
|
+
<dt>x_1_</dt>
|
1796
|
+
<dd>
|
1797
|
+
<p id='_'>Definition 3</p>
|
1798
|
+
</dd>
|
1799
|
+
<dt>Xa</dt>
|
1800
|
+
<dd>
|
1801
|
+
<p id='_'>Definition 2</p>
|
1802
|
+
</dd>
|
1803
|
+
<dt>α</dt>
|
1804
|
+
<dd>
|
1805
|
+
<p id='_'>Definition 1</p>
|
1806
|
+
</dd>
|
1807
|
+
</dl>
|
1808
|
+
</definitions>
|
1809
|
+
</sections>
|
1810
|
+
</standard-document>
|
1811
|
+
OUTPUT
|
1812
|
+
end
|
1892
1813
|
|
1893
|
-
it "
|
1894
|
-
|
1895
|
-
|
1896
|
-
|
1897
|
-
== Clause
|
1898
|
-
|
1899
|
-
[.requirement,subsequence="A",inherit="/ss/584/2015/level/1 & /ss/584/2015/level/2"]
|
1900
|
-
.Title
|
1901
|
-
====
|
1902
|
-
inherit:[A]
|
1903
|
-
inherit:[B]
|
1904
|
-
I recommend this
|
1905
|
-
====
|
1906
|
-
|
1907
|
-
[.requirement,subsequence="A",classification="X:Y"]
|
1908
|
-
.Title
|
1909
|
-
====
|
1910
|
-
inherit:[A]
|
1911
|
-
I recommend this
|
1912
|
-
====
|
1913
|
-
|
1914
|
-
[.requirement,subsequence="A"]
|
1915
|
-
.Title
|
1916
|
-
====
|
1917
|
-
inherit:[A]
|
1918
|
-
I recommend this
|
1919
|
-
====
|
1920
|
-
|
1921
|
-
[.requirement,subsequence="A"]
|
1922
|
-
.Title
|
1923
|
-
====
|
1924
|
-
inherit:[A]
|
1925
|
-
====
|
1926
|
-
|
1927
|
-
|
1928
|
-
INPUT
|
1929
|
-
#{BLANK_HDR}
|
1930
|
-
<sections>
|
1931
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
1932
|
-
<title>Clause</title>
|
1933
|
-
<requirement id='_' subsequence='A'>
|
1934
|
-
<title>Title</title>
|
1935
|
-
<inherit>/ss/584/2015/level/1 & /ss/584/2015/level/2</inherit>
|
1936
|
-
<inherit>A</inherit>
|
1937
|
-
<inherit>B</inherit>
|
1938
|
-
<description>
|
1939
|
-
<p id='_'> I recommend this</p>
|
1940
|
-
</description>
|
1941
|
-
</requirement>
|
1942
|
-
<requirement id='_' subsequence='A'>
|
1943
|
-
<title>Title</title>
|
1944
|
-
<inherit>A</inherit>
|
1945
|
-
<classification>
|
1946
|
-
<tag>X</tag>
|
1947
|
-
<value>Y</value>
|
1948
|
-
</classification>
|
1949
|
-
<description>
|
1950
|
-
<p id='_'> I recommend this</p>
|
1951
|
-
</description>
|
1952
|
-
</requirement>
|
1953
|
-
<requirement id='_' subsequence='A'>
|
1954
|
-
<title>Title</title>
|
1955
|
-
<inherit>A</inherit>
|
1956
|
-
<description>
|
1957
|
-
<p id='_'> I recommend this</p>
|
1958
|
-
</description>
|
1959
|
-
</requirement>
|
1960
|
-
<requirement id='_' subsequence='A'>
|
1961
|
-
<title>Title</title>
|
1962
|
-
<inherit>A</inherit>
|
1963
|
-
<description>
|
1964
|
-
<p id='_'> </p>
|
1965
|
-
</description>
|
1966
|
-
</requirement>
|
1967
|
-
</clause>
|
1968
|
-
</sections>
|
1969
|
-
</standard-document>
|
1970
|
-
OUTPUT
|
1971
|
-
end
|
1814
|
+
it "sorts symbols lists" do
|
1815
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
1816
|
+
#{ASCIIDOC_BLANK_HDR}
|
1972
1817
|
|
1973
|
-
|
1974
|
-
|
1975
|
-
#{ASCIIDOC_BLANK_HDR}
|
1976
|
-
|
1977
|
-
.Foreword
|
1978
|
-
Foreword
|
1979
|
-
|
1980
|
-
[NOTE,beforeclauses=true]
|
1981
|
-
====
|
1982
|
-
Note which is very important
|
1983
|
-
====
|
1984
|
-
|
1985
|
-
== Introduction
|
1986
|
-
Introduction
|
1987
|
-
|
1988
|
-
== Scope
|
1989
|
-
Scope statement
|
1990
|
-
|
1991
|
-
[IMPORTANT,beforeclauses=true]
|
1992
|
-
====
|
1993
|
-
Notice which is very important
|
1994
|
-
====
|
1995
|
-
INPUT
|
1996
|
-
#{BLANK_HDR}
|
1997
|
-
<preface>
|
1998
|
-
<note id='_'>
|
1999
|
-
<p id='_'>Note which is very important</p>
|
2000
|
-
</note>
|
2001
|
-
<foreword id='_' obligation='informative'>
|
2002
|
-
<title>Foreword</title>
|
2003
|
-
<p id='_'>Foreword</p>
|
2004
|
-
</foreword>
|
2005
|
-
<introduction id='_' obligation='informative'>
|
2006
|
-
<title>Introduction</title>
|
2007
|
-
<p id='_'>Introduction</p>
|
2008
|
-
</introduction>
|
2009
|
-
</preface>
|
2010
|
-
<sections>
|
2011
|
-
<admonition id='_' type='important'>
|
2012
|
-
<p id='_'>Notice which is very important</p>
|
2013
|
-
</admonition>
|
2014
|
-
<clause id='_' inline-header='false' obligation='normative' type="scope">
|
2015
|
-
<title>Scope</title>
|
2016
|
-
<p id='_'>Scope statement</p>
|
2017
|
-
</clause>
|
2018
|
-
</sections>
|
2019
|
-
</standard-document>
|
2020
|
-
|
2021
|
-
OUTPUT
|
2022
|
-
end
|
1818
|
+
[[L]]
|
1819
|
+
== Symbols and abbreviated terms
|
2023
1820
|
|
1821
|
+
stem:[alpha]:: Definition 1
|
1822
|
+
xa:: Definition 2
|
1823
|
+
stem:[x_1]:: Definition 3
|
1824
|
+
stem:[x_m]:: Definition 4
|
1825
|
+
x:: Definition 5
|
1826
|
+
INPUT
|
1827
|
+
#{BLANK_HDR}
|
1828
|
+
<sections>
|
1829
|
+
<definitions id='L' obligation="normative">
|
1830
|
+
<title>Symbols and abbreviated terms</title>
|
1831
|
+
<dl id='_'>
|
1832
|
+
<dt>x</dt>
|
1833
|
+
<dd>
|
1834
|
+
<p id='_'>Definition 5</p>
|
1835
|
+
</dd>
|
1836
|
+
<dt><stem type='MathML'>
|
1837
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
1838
|
+
<msub>
|
1839
|
+
<mrow>
|
1840
|
+
<mi>x</mi>
|
1841
|
+
</mrow>
|
1842
|
+
<mrow>
|
1843
|
+
<mi>m</mi>
|
1844
|
+
</mrow>
|
1845
|
+
</msub>
|
1846
|
+
</math>
|
1847
|
+
</stem></dt>
|
1848
|
+
<dd>
|
1849
|
+
<p id='_'>Definition 4</p>
|
1850
|
+
</dd>
|
1851
|
+
<dt><stem type='MathML'>
|
1852
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
1853
|
+
<msub>
|
1854
|
+
<mrow>
|
1855
|
+
<mi>x</mi>
|
1856
|
+
</mrow>
|
1857
|
+
<mrow>
|
1858
|
+
<mn>1</mn>
|
1859
|
+
</mrow>
|
1860
|
+
</msub>
|
1861
|
+
</math>
|
1862
|
+
</stem></dt>
|
1863
|
+
<dd>
|
1864
|
+
<p id='_'>Definition 3</p>
|
1865
|
+
</dd>
|
1866
|
+
<dt>xa</dt>
|
1867
|
+
<dd>
|
1868
|
+
<p id='_'>Definition 2</p>
|
1869
|
+
</dd>
|
1870
|
+
<dt>
|
1871
|
+
<stem type='MathML'>
|
1872
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
1873
|
+
<mi>α</mi>
|
1874
|
+
</math>
|
1875
|
+
</stem>
|
1876
|
+
</dt>
|
1877
|
+
<dd>
|
1878
|
+
<p id='_'>Definition 1</p>
|
1879
|
+
</dd>
|
1880
|
+
</dl>
|
1881
|
+
</definitions>
|
1882
|
+
</sections>
|
1883
|
+
</standard-document>
|
1884
|
+
OUTPUT
|
1885
|
+
end
|
2024
1886
|
|
2025
|
-
it "
|
2026
|
-
|
2027
|
-
#{ASCIIDOC_BLANK_HDR}
|
2028
|
-
|
2029
|
-
[[a:b]]
|
2030
|
-
== A
|
2031
|
-
<</:ab>>
|
2032
|
-
<<:>>
|
2033
|
-
<<1>>
|
2034
|
-
<<1:>>
|
2035
|
-
<<1#b>>
|
2036
|
-
<<:a#b:>>
|
2037
|
-
<</%ab>>
|
2038
|
-
<<1!>>
|
2039
|
-
|
2040
|
-
INPUT
|
2041
|
-
expect(xmlpp(Asciidoctor.convert(input, backend: :standoc, header_footer: true).gsub(/<p id="_[^"]+">/, "").gsub('</p>', ""))).to be_equivalent_to (<<~"OUTPUT")
|
2042
|
-
<standard-document xmlns='https://www.metanorma.org/ns/standoc' type="semantic" version="#{Metanorma::Standoc::VERSION}">
|
2043
|
-
<bibdata type='standard'>
|
2044
|
-
<title language='en' format='text/plain'>Document title</title>
|
2045
|
-
<language>en</language>
|
2046
|
-
<script>Latn</script>
|
2047
|
-
<status>
|
2048
|
-
<stage>published</stage>
|
2049
|
-
</status>
|
2050
|
-
<copyright>
|
2051
|
-
<from>#{Time.now.year}</from>
|
2052
|
-
</copyright>
|
2053
|
-
<ext>
|
2054
|
-
<doctype>article</doctype>
|
2055
|
-
</ext>
|
2056
|
-
</bibdata>
|
2057
|
-
<sections>
|
2058
|
-
<clause id='a_b' inline-header='false' obligation='normative'>
|
2059
|
-
<title>A</title>
|
2060
|
-
<eref bibitemid='__ab' citeas=''/>
|
2061
|
-
<xref target='_'/>
|
2062
|
-
<xref target='_1'/>
|
2063
|
-
<xref target='_1_'/>
|
2064
|
-
<xref target='1#b'/>
|
2065
|
-
<xref target='_a#b_'/>
|
2066
|
-
<xref target='_%ab'/>
|
2067
|
-
<xref target='_1_'/>
|
2068
|
-
</clause>
|
2069
|
-
</sections>
|
2070
|
-
<bibliography>
|
2071
|
-
<references hidden='true' normative='false'>
|
2072
|
-
<bibitem id='__ab' type='internal'>
|
2073
|
-
<docidentifier type='repository'>//ab</docidentifier>
|
2074
|
-
</bibitem>
|
2075
|
-
</references>
|
2076
|
-
</bibliography>
|
2077
|
-
</standard-document>
|
2078
|
-
OUTPUT
|
2079
|
-
expect{Asciidoctor.convert(input, backend: :standoc, header_footer: true)}.to output(%r{normalised identifier in <clause id="a_b" inline-header="false" obligation="normative"/> from a:b}).to_stderr
|
2080
|
-
expect{Asciidoctor.convert(input, backend: :standoc, header_footer: true)}.to output(%r{normalised identifier in <eref bibitemid="__ab" citeas=""/> from /_ab}).to_stderr
|
2081
|
-
expect{Asciidoctor.convert(input, backend: :standoc, header_footer: true)}.to output(%r{normalised identifier in <xref target="_"/> from :}).to_stderr
|
2082
|
-
expect{Asciidoctor.convert(input, backend: :standoc, header_footer: true)}.to output(%r{normalised identifier in <xref target="_1"/> from 1}).to_stderr
|
2083
|
-
expect{Asciidoctor.convert(input, backend: :standoc, header_footer: true)}.to output(%r{normalised identifier in <xref target="_1_"/> from 1:}).to_stderr
|
2084
|
-
expect{Asciidoctor.convert(input, backend: :standoc, header_footer: true)}.to output(%r{normalised identifier in <xref target="_a#b_"/> from :a#b:}).to_stderr
|
2085
|
-
end
|
1887
|
+
it "moves inherit macros to correct location" do
|
1888
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
1889
|
+
#{ASCIIDOC_BLANK_HDR}
|
2086
1890
|
|
2087
|
-
|
2088
|
-
|
2089
|
-
=
|
2090
|
-
|
2091
|
-
|
2092
|
-
:
|
2093
|
-
:
|
2094
|
-
|
2095
|
-
|
2096
|
-
|
2097
|
-
|
2098
|
-
|
2099
|
-
|
2100
|
-
|
2101
|
-
|
2102
|
-
|
2103
|
-
|
2104
|
-
|
2105
|
-
|
2106
|
-
|
2107
|
-
|
2108
|
-
|
2109
|
-
|
2110
|
-
|
2111
|
-
|
2112
|
-
|
2113
|
-
|
2114
|
-
|
2115
|
-
|
2116
|
-
<doctype>article</doctype>
|
2117
|
-
</ext>
|
2118
|
-
</bibdata>
|
2119
|
-
<sections> </sections>
|
2120
|
-
</standard-document>
|
2121
|
-
OUTPUT
|
1891
|
+
== Clause
|
1892
|
+
|
1893
|
+
[.requirement,subsequence="A",inherit="/ss/584/2015/level/1 & /ss/584/2015/level/2"]
|
1894
|
+
.Title
|
1895
|
+
====
|
1896
|
+
inherit:[A]
|
1897
|
+
inherit:[B]
|
1898
|
+
I recommend this
|
1899
|
+
====
|
1900
|
+
|
1901
|
+
[.requirement,subsequence="A",classification="X:Y"]
|
1902
|
+
.Title
|
1903
|
+
====
|
1904
|
+
inherit:[A]
|
1905
|
+
I recommend this
|
1906
|
+
====
|
1907
|
+
|
1908
|
+
[.requirement,subsequence="A"]
|
1909
|
+
.Title
|
1910
|
+
====
|
1911
|
+
inherit:[A]
|
1912
|
+
I recommend this
|
1913
|
+
====
|
1914
|
+
|
1915
|
+
[.requirement,subsequence="A"]
|
1916
|
+
.Title
|
1917
|
+
====
|
1918
|
+
inherit:[A]
|
1919
|
+
====
|
2122
1920
|
|
2123
|
-
end
|
2124
1921
|
|
2125
|
-
|
2126
|
-
|
2127
|
-
|
2128
|
-
|
2129
|
-
|
2130
|
-
|
2131
|
-
|
2132
|
-
|
2133
|
-
<
|
2134
|
-
|
2135
|
-
|
2136
|
-
|
2137
|
-
|
2138
|
-
|
2139
|
-
|
2140
|
-
|
2141
|
-
</
|
2142
|
-
|
2143
|
-
|
2144
|
-
|
2145
|
-
|
2146
|
-
|
2147
|
-
|
2148
|
-
|
2149
|
-
|
2150
|
-
|
2151
|
-
|
2152
|
-
|
2153
|
-
|
2154
|
-
|
2155
|
-
|
2156
|
-
|
2157
|
-
|
2158
|
-
|
2159
|
-
|
2160
|
-
|
2161
|
-
|
2162
|
-
|
1922
|
+
INPUT
|
1923
|
+
#{BLANK_HDR}
|
1924
|
+
<sections>
|
1925
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
1926
|
+
<title>Clause</title>
|
1927
|
+
<requirement id='_' subsequence='A'>
|
1928
|
+
<title>Title</title>
|
1929
|
+
<inherit>/ss/584/2015/level/1 & /ss/584/2015/level/2</inherit>
|
1930
|
+
<inherit>A</inherit>
|
1931
|
+
<inherit>B</inherit>
|
1932
|
+
<description>
|
1933
|
+
<p id='_'> I recommend this</p>
|
1934
|
+
</description>
|
1935
|
+
</requirement>
|
1936
|
+
<requirement id='_' subsequence='A'>
|
1937
|
+
<title>Title</title>
|
1938
|
+
<inherit>A</inherit>
|
1939
|
+
<classification>
|
1940
|
+
<tag>X</tag>
|
1941
|
+
<value>Y</value>
|
1942
|
+
</classification>
|
1943
|
+
<description>
|
1944
|
+
<p id='_'> I recommend this</p>
|
1945
|
+
</description>
|
1946
|
+
</requirement>
|
1947
|
+
<requirement id='_' subsequence='A'>
|
1948
|
+
<title>Title</title>
|
1949
|
+
<inherit>A</inherit>
|
1950
|
+
<description>
|
1951
|
+
<p id='_'> I recommend this</p>
|
1952
|
+
</description>
|
1953
|
+
</requirement>
|
1954
|
+
<requirement id='_' subsequence='A'>
|
1955
|
+
<title>Title</title>
|
1956
|
+
<inherit>A</inherit>
|
1957
|
+
<description>
|
1958
|
+
<p id='_'> </p>
|
1959
|
+
</description>
|
1960
|
+
</requirement>
|
1961
|
+
</clause>
|
1962
|
+
</sections>
|
1963
|
+
</standard-document>
|
1964
|
+
OUTPUT
|
1965
|
+
end
|
1966
|
+
|
1967
|
+
it "moves %beforeclause admonitions to right position" do
|
1968
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
1969
|
+
#{ASCIIDOC_BLANK_HDR}
|
1970
|
+
|
1971
|
+
.Foreword
|
1972
|
+
Foreword
|
1973
|
+
|
1974
|
+
[NOTE,beforeclauses=true]
|
1975
|
+
====
|
1976
|
+
Note which is very important
|
1977
|
+
====
|
1978
|
+
|
1979
|
+
== Introduction
|
1980
|
+
Introduction
|
1981
|
+
|
1982
|
+
== Scope
|
1983
|
+
Scope statement
|
1984
|
+
|
1985
|
+
[IMPORTANT,beforeclauses=true]
|
1986
|
+
====
|
1987
|
+
Notice which is very important
|
1988
|
+
====
|
1989
|
+
INPUT
|
1990
|
+
#{BLANK_HDR}
|
1991
|
+
<preface>
|
1992
|
+
<note id='_'>
|
1993
|
+
<p id='_'>Note which is very important</p>
|
1994
|
+
</note>
|
1995
|
+
<foreword id='_' obligation='informative'>
|
1996
|
+
<title>Foreword</title>
|
1997
|
+
<p id='_'>Foreword</p>
|
1998
|
+
</foreword>
|
1999
|
+
<introduction id='_' obligation='informative'>
|
2000
|
+
<title>Introduction</title>
|
2001
|
+
<p id='_'>Introduction</p>
|
2002
|
+
</introduction>
|
2003
|
+
</preface>
|
2004
|
+
<sections>
|
2005
|
+
<admonition id='_' type='important'>
|
2006
|
+
<p id='_'>Notice which is very important</p>
|
2007
|
+
</admonition>
|
2008
|
+
<clause id='_' inline-header='false' obligation='normative' type="scope">
|
2009
|
+
<title>Scope</title>
|
2010
|
+
<p id='_'>Scope statement</p>
|
2011
|
+
</clause>
|
2012
|
+
</sections>
|
2013
|
+
</standard-document>
|
2014
|
+
OUTPUT
|
2015
|
+
end
|
2016
|
+
|
2017
|
+
it "fixes illegal anchors" do
|
2018
|
+
input = <<~INPUT
|
2019
|
+
#{ASCIIDOC_BLANK_HDR}
|
2020
|
+
|
2021
|
+
[[a:b]]
|
2022
|
+
== A
|
2023
|
+
<</:ab>>
|
2024
|
+
<<:>>
|
2025
|
+
<<1>>
|
2026
|
+
<<1:>>
|
2027
|
+
<<1#b>>
|
2028
|
+
<<:a#b:>>
|
2029
|
+
<</%ab>>
|
2030
|
+
<<1!>>
|
2031
|
+
INPUT
|
2032
|
+
expect(xmlpp(Asciidoctor.convert(input, *OPTIONS).gsub(/<p id="_[^"]+">/, "").gsub("</p>", ""))).to be_equivalent_to (<<~"OUTPUT")
|
2033
|
+
<standard-document xmlns='https://www.metanorma.org/ns/standoc' type="semantic" version="#{Metanorma::Standoc::VERSION}">
|
2034
|
+
<bibdata type='standard'>
|
2035
|
+
<title language='en' format='text/plain'>Document title</title>
|
2036
|
+
<language>en</language>
|
2037
|
+
<script>Latn</script>
|
2038
|
+
<status>
|
2039
|
+
<stage>published</stage>
|
2040
|
+
</status>
|
2041
|
+
<copyright>
|
2042
|
+
<from>#{Time.now.year}</from>
|
2043
|
+
</copyright>
|
2044
|
+
<ext>
|
2045
|
+
<doctype>article</doctype>
|
2046
|
+
</ext>
|
2047
|
+
</bibdata>
|
2048
|
+
<sections>
|
2049
|
+
<clause id='a_b' inline-header='false' obligation='normative'>
|
2050
|
+
<title>A</title>
|
2051
|
+
<eref bibitemid='__ab' citeas=''/>
|
2052
|
+
<xref target='_'/>
|
2053
|
+
<xref target='_1'/>
|
2054
|
+
<xref target='_1_'/>
|
2055
|
+
<xref target='1#b'/>
|
2056
|
+
<xref target='_a#b_'/>
|
2057
|
+
<xref target='_%ab'/>
|
2058
|
+
<xref target='_1_'/>
|
2059
|
+
</clause>
|
2060
|
+
</sections>
|
2061
|
+
<bibliography>
|
2062
|
+
<references hidden='true' normative='false'>
|
2063
|
+
<bibitem id='__ab' type='internal'>
|
2064
|
+
<docidentifier type='repository'>//ab</docidentifier>
|
2065
|
+
</bibitem>
|
2066
|
+
</references>
|
2067
|
+
</bibliography>
|
2068
|
+
</standard-document>
|
2069
|
+
OUTPUT
|
2070
|
+
expect { Asciidoctor.convert(input, *OPTIONS) }.to output(%r{normalised identifier in <clause id="a_b" inline-header="false" obligation="normative"/> from a:b}).to_stderr
|
2071
|
+
expect { Asciidoctor.convert(input, *OPTIONS) }.to output(%r{normalised identifier in <eref bibitemid="__ab" citeas=""/> from /_ab}).to_stderr
|
2072
|
+
expect { Asciidoctor.convert(input, *OPTIONS) }.to output(%r{normalised identifier in <xref target="_"/> from :}).to_stderr
|
2073
|
+
expect { Asciidoctor.convert(input, *OPTIONS) }.to output(%r{normalised identifier in <xref target="_1"/> from 1}).to_stderr
|
2074
|
+
expect { Asciidoctor.convert(input, *OPTIONS) }.to output(%r{normalised identifier in <xref target="_1_"/> from 1:}).to_stderr
|
2075
|
+
expect { Asciidoctor.convert(input, *OPTIONS) }.to output(%r{normalised identifier in <xref target="_a#b_"/> from :a#b:}).to_stderr
|
2076
|
+
end
|
2077
|
+
|
2078
|
+
it "moves title footnotes to bibdata" do
|
2079
|
+
input = <<~INPUT
|
2080
|
+
= Document title footnote:[ABC] footnote:[DEF]
|
2081
|
+
Author
|
2082
|
+
:docfile: test.adoc
|
2083
|
+
:nodoc:
|
2084
|
+
:novalid:
|
2085
|
+
:no-isobib:
|
2086
|
+
|
2087
|
+
INPUT
|
2088
|
+
expect(xmlpp(Asciidoctor.convert(input, *OPTIONS))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
2089
|
+
<standard-document xmlns='https://www.metanorma.org/ns/standoc' type="semantic" version="#{Metanorma::Standoc::VERSION}">
|
2090
|
+
<bibdata type='standard'>
|
2091
|
+
<title language='en' format='text/plain'>Document title</title>
|
2092
|
+
<note type='title-footnote'>
|
2093
|
+
<p>ABC</p>
|
2094
|
+
</note>
|
2095
|
+
<note type='title-footnote'>
|
2096
|
+
<p>DEF</p>
|
2097
|
+
</note>
|
2098
|
+
<language>en</language>
|
2099
|
+
<script>Latn</script>
|
2100
|
+
<status>
|
2101
|
+
<stage>published</stage>
|
2102
|
+
</status>
|
2103
|
+
<copyright>
|
2104
|
+
<from>#{Time.now.year}</from>
|
2105
|
+
</copyright>
|
2106
|
+
<ext>
|
2107
|
+
<doctype>article</doctype>
|
2108
|
+
</ext>
|
2109
|
+
</bibdata>
|
2110
|
+
<sections> </sections>
|
2111
|
+
</standard-document>
|
2112
|
+
OUTPUT
|
2113
|
+
end
|
2114
|
+
|
2115
|
+
it "converts UnitsML to MathML" do
|
2116
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~INPUT, *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
2117
|
+
= Document title
|
2118
|
+
Author
|
2119
|
+
:stem:
|
2120
|
+
|
2121
|
+
[stem]
|
2122
|
+
++++
|
2123
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
2124
|
+
<mrow>
|
2125
|
+
<mn>7</mn>
|
2126
|
+
<mtext>unitsml(m*kg^-2)</mtext>
|
2127
|
+
<mo>+</mo>
|
2128
|
+
<mn>8</mn>
|
2129
|
+
<mtext>unitsml(m*kg^-2)</mtext>
|
2130
|
+
</mrow>
|
2131
|
+
</math>
|
2132
|
+
++++
|
2133
|
+
INPUT
|
2134
|
+
#{BLANK_HDR}
|
2135
|
+
<misc-container>
|
2136
|
+
<UnitsML xmlns='https://schema.unitsml.org/unitsml/1.0'>
|
2137
|
+
<UnitSet>
|
2138
|
+
<Unit xml:id='U_m.kg-2' dimensionURL='#D_LM-2'>
|
2139
|
+
<UnitSystem name='SI' type='SI_derived' xml:lang='en-US'/>
|
2140
|
+
<UnitName xml:lang='en'>m*kg^-2</UnitName>
|
2141
|
+
<UnitSymbol type='HTML'>
|
2142
|
+
m kg
|
2143
|
+
<sup>−2</sup>
|
2144
|
+
</UnitSymbol>
|
2145
|
+
<UnitSymbol type='MathML'>
|
2146
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
2147
|
+
<mrow>
|
2148
|
+
<mi mathvariant='normal'>m</mi>
|
2149
|
+
<mo rspace='thickmathspace'>⁢</mo>
|
2150
|
+
<msup>
|
2151
|
+
<mrow>
|
2152
|
+
<mi mathvariant='normal'>kg</mi>
|
2153
|
+
</mrow>
|
2154
|
+
<mrow>
|
2155
|
+
<mo>−</mo>
|
2156
|
+
<mn>2</mn>
|
2157
|
+
</mrow>
|
2158
|
+
</msup>
|
2159
|
+
</mrow>
|
2160
|
+
</math>
|
2161
|
+
</UnitSymbol>
|
2162
|
+
<RootUnits>
|
2163
|
+
<EnumeratedRootUnit unit='meter'/>
|
2164
|
+
<EnumeratedRootUnit unit='gram' prefix='k' powerNumerator='-2'/>
|
2165
|
+
</RootUnits>
|
2166
|
+
</Unit>
|
2167
|
+
</UnitSet>
|
2168
|
+
<DimensionSet>
|
2169
|
+
<Dimension xml:id='D_LM-2'>
|
2170
|
+
<Length symbol='L' powerNumerator='1'/>
|
2171
|
+
<Mass symbol='M' powerNumerator='-2'/>
|
2172
|
+
</Dimension>
|
2173
|
+
</DimensionSet>
|
2174
|
+
<PrefixSet>
|
2175
|
+
<Prefix prefixBase='10' prefixPower='3' xml:id='NISTp10_3'>
|
2176
|
+
<PrefixName xml:lang='en'>kilo</PrefixName>
|
2177
|
+
<PrefixSymbol type='ASCII'>k</PrefixSymbol>
|
2178
|
+
<PrefixSymbol type='unicode'>k</PrefixSymbol>
|
2179
|
+
<PrefixSymbol type='LaTeX'>k</PrefixSymbol>
|
2180
|
+
<PrefixSymbol type='HTML'>k</PrefixSymbol>
|
2181
|
+
</Prefix>
|
2182
|
+
</PrefixSet>
|
2183
|
+
</UnitsML>
|
2184
|
+
</misc-container>
|
2185
|
+
<sections>
|
2186
|
+
<formula id='_'>
|
2187
|
+
<stem type='MathML'>
|
2188
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
2189
|
+
<mrow>
|
2190
|
+
<mn>7</mn>
|
2191
|
+
<mo rspace='thickmathspace'>⁢</mo>
|
2192
|
+
<mrow xref='U_m.kg-2'>
|
2193
|
+
<mi mathvariant='normal'>m</mi>
|
2194
|
+
<mo rspace='thickmathspace'>⁢</mo>
|
2195
|
+
<msup>
|
2196
|
+
<mrow>
|
2197
|
+
<mi mathvariant='normal'>kg</mi>
|
2198
|
+
</mrow>
|
2199
|
+
<mrow>
|
2200
|
+
<mo>−</mo>
|
2201
|
+
<mn>2</mn>
|
2202
|
+
</mrow>
|
2203
|
+
</msup>
|
2163
2204
|
</mrow>
|
2164
|
-
<
|
2165
|
-
|
2166
|
-
|
2205
|
+
<mo>+</mo>
|
2206
|
+
<mn>8</mn>
|
2207
|
+
<mo rspace='thickmathspace'>⁢</mo>
|
2208
|
+
<mrow xref='U_m.kg-2'>
|
2209
|
+
<mi mathvariant='normal'>m</mi>
|
2210
|
+
<mo rspace='thickmathspace'>⁢</mo>
|
2211
|
+
<msup>
|
2212
|
+
<mrow>
|
2213
|
+
<mi mathvariant='normal'>kg</mi>
|
2214
|
+
</mrow>
|
2215
|
+
<mrow>
|
2216
|
+
<mo>−</mo>
|
2217
|
+
<mn>2</mn>
|
2218
|
+
</mrow>
|
2219
|
+
</msup>
|
2167
2220
|
</mrow>
|
2168
|
-
</msup>
|
2169
|
-
</mrow>
|
2170
|
-
</math>
|
2171
|
-
</UnitSymbol>
|
2172
|
-
<RootUnits>
|
2173
|
-
<EnumeratedRootUnit unit='meter'/>
|
2174
|
-
<EnumeratedRootUnit unit='gram' prefix='k' powerNumerator='-2'/>
|
2175
|
-
</RootUnits>
|
2176
|
-
</Unit>
|
2177
|
-
</UnitSet>
|
2178
|
-
<DimensionSet>
|
2179
|
-
<Dimension xml:id='D_LM-2'>
|
2180
|
-
<Length symbol='L' powerNumerator='1'/>
|
2181
|
-
<Mass symbol='M' powerNumerator='-2'/>
|
2182
|
-
</Dimension>
|
2183
|
-
</DimensionSet>
|
2184
|
-
<PrefixSet>
|
2185
|
-
<Prefix prefixBase='10' prefixPower='3' xml:id='NISTp10_3'>
|
2186
|
-
<PrefixName xml:lang='en'>kilo</PrefixName>
|
2187
|
-
<PrefixSymbol type='ASCII'>k</PrefixSymbol>
|
2188
|
-
<PrefixSymbol type='unicode'>k</PrefixSymbol>
|
2189
|
-
<PrefixSymbol type='LaTeX'>k</PrefixSymbol>
|
2190
|
-
<PrefixSymbol type='HTML'>k</PrefixSymbol>
|
2191
|
-
</Prefix>
|
2192
|
-
</PrefixSet>
|
2193
|
-
</UnitsML>
|
2194
|
-
</misc-container>
|
2195
|
-
<sections>
|
2196
|
-
<formula id='_'>
|
2197
|
-
<stem type='MathML'>
|
2198
|
-
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
2199
|
-
<mrow>
|
2200
|
-
<mn>7</mn>
|
2201
|
-
<mo rspace='thickmathspace'>⁢</mo>
|
2202
|
-
<mrow xref='U_m.kg-2'>
|
2203
|
-
<mi mathvariant='normal'>m</mi>
|
2204
|
-
<mo rspace='thickmathspace'>⁢</mo>
|
2205
|
-
<msup>
|
2206
|
-
<mrow>
|
2207
|
-
<mi mathvariant='normal'>kg</mi>
|
2208
|
-
</mrow>
|
2209
|
-
<mrow>
|
2210
|
-
<mo>−</mo>
|
2211
|
-
<mn>2</mn>
|
2212
|
-
</mrow>
|
2213
|
-
</msup>
|
2214
|
-
</mrow>
|
2215
|
-
<mo>+</mo>
|
2216
|
-
<mn>8</mn>
|
2217
|
-
<mo rspace='thickmathspace'>⁢</mo>
|
2218
|
-
<mrow xref='U_m.kg-2'>
|
2219
|
-
<mi mathvariant='normal'>m</mi>
|
2220
|
-
<mo rspace='thickmathspace'>⁢</mo>
|
2221
|
-
<msup>
|
2222
|
-
<mrow>
|
2223
|
-
<mi mathvariant='normal'>kg</mi>
|
2224
2221
|
</mrow>
|
2225
|
-
|
2226
|
-
|
2227
|
-
|
2228
|
-
|
2229
|
-
|
2230
|
-
|
2231
|
-
|
2232
|
-
</math>
|
2233
|
-
</stem>
|
2234
|
-
</formula>
|
2235
|
-
</sections>
|
2236
|
-
</standard-document>
|
2237
|
-
OUTPUT
|
2222
|
+
</math>
|
2223
|
+
</stem>
|
2224
|
+
</formula>
|
2225
|
+
</sections>
|
2226
|
+
</standard-document>
|
2227
|
+
OUTPUT
|
2228
|
+
end
|
2238
2229
|
|
2239
|
-
|
2230
|
+
it "customises italicisation of MathML" do
|
2231
|
+
input = <<~INPUT
|
2232
|
+
= Document title
|
2233
|
+
Author
|
2234
|
+
:stem:
|
2235
|
+
|
2236
|
+
[stem]
|
2237
|
+
++++
|
2238
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
2239
|
+
<mi>A</mi>
|
2240
|
+
<mo>+</mo>
|
2241
|
+
<mi>a</mi>
|
2242
|
+
<mo>+</mo>
|
2243
|
+
<mi>Α</mi>
|
2244
|
+
<mo>+</mo>
|
2245
|
+
<mi>α</mi>
|
2246
|
+
<mo>+</mo>
|
2247
|
+
<mi>AB</mi>
|
2248
|
+
<mstyle mathvariant="italic">
|
2249
|
+
<mrow>
|
2250
|
+
<mi>Α</mi>
|
2251
|
+
</mrow>
|
2252
|
+
</mstyle>
|
2253
|
+
</math>
|
2254
|
+
++++
|
2255
|
+
INPUT
|
2240
2256
|
|
2241
|
-
|
2242
|
-
|
2243
|
-
|
2244
|
-
|
2245
|
-
|
2246
|
-
|
2247
|
-
|
2248
|
-
|
2249
|
-
<
|
2250
|
-
|
2251
|
-
|
2252
|
-
|
2253
|
-
|
2254
|
-
|
2255
|
-
|
2256
|
-
|
2257
|
-
|
2258
|
-
<mi>AB</mi>
|
2259
|
-
<mstyle mathvariant="italic">
|
2260
|
-
<mrow>
|
2261
|
-
<mi>Α</mi>
|
2262
|
-
</mrow>
|
2263
|
-
</mstyle>
|
2264
|
-
</math>
|
2265
|
-
++++
|
2266
|
-
INPUT
|
2267
|
-
|
2268
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(input, backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
2269
|
-
#{BLANK_HDR}
|
2270
|
-
<sections>
|
2271
|
-
<formula id='_'>
|
2272
|
-
<stem type='MathML'>
|
2273
|
-
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
2274
|
-
<mi>A</mi>
|
2275
|
-
<mo>+</mo>
|
2276
|
-
<mi>a</mi>
|
2277
|
-
<mo>+</mo>
|
2257
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
2258
|
+
#{BLANK_HDR}
|
2259
|
+
<sections>
|
2260
|
+
<formula id='_'>
|
2261
|
+
<stem type='MathML'>
|
2262
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
2263
|
+
<mi>A</mi>
|
2264
|
+
<mo>+</mo>
|
2265
|
+
<mi>a</mi>
|
2266
|
+
<mo>+</mo>
|
2267
|
+
<mi>Α</mi>
|
2268
|
+
<mo>+</mo>
|
2269
|
+
<mi>α</mi>
|
2270
|
+
<mo>+</mo>
|
2271
|
+
<mi>AB</mi>
|
2272
|
+
<mstyle mathvariant='italic'>
|
2273
|
+
<mrow>
|
2278
2274
|
<mi>Α</mi>
|
2279
|
-
|
2280
|
-
|
2281
|
-
|
2282
|
-
|
2283
|
-
|
2284
|
-
|
2285
|
-
|
2286
|
-
|
2287
|
-
|
2288
|
-
|
2289
|
-
|
2290
|
-
|
2291
|
-
|
2292
|
-
|
2293
|
-
|
2294
|
-
|
2295
|
-
|
2296
|
-
|
2297
|
-
|
2298
|
-
|
2299
|
-
|
2300
|
-
|
2301
|
-
|
2302
|
-
|
2303
|
-
|
2304
|
-
|
2305
|
-
<mi mathvariant="normal">Α</mi>
|
2306
|
-
<mo>+</mo>
|
2307
|
-
<mi>α</mi>
|
2308
|
-
<mo>+</mo>
|
2309
|
-
<mi>AB</mi>
|
2310
|
-
<mstyle mathvariant='italic'>
|
2311
|
-
<mrow>
|
2312
|
-
<mi>Α</mi>
|
2313
|
-
</mrow>
|
2314
|
-
</mstyle>
|
2315
|
-
</math>
|
2316
|
-
</stem>
|
2317
|
-
</formula>
|
2318
|
-
</sections>
|
2319
|
-
</standard-document>
|
2320
|
-
OUTPUT
|
2321
|
-
mock_mathml_italicise({ uppergreek: true, upperroman: false, lowergreek: true, lowerroman: true })
|
2322
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(input, backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
2323
|
-
#{BLANK_HDR}
|
2324
|
-
<sections>
|
2325
|
-
<formula id='_'>
|
2326
|
-
<stem type='MathML'>
|
2327
|
-
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
2328
|
-
<mi mathvariant="normal">A</mi>
|
2329
|
-
<mo>+</mo>
|
2330
|
-
<mi>a</mi>
|
2331
|
-
<mo>+</mo>
|
2275
|
+
</mrow>
|
2276
|
+
</mstyle>
|
2277
|
+
</math>
|
2278
|
+
</stem>
|
2279
|
+
</formula>
|
2280
|
+
</sections>
|
2281
|
+
</standard-document>
|
2282
|
+
OUTPUT
|
2283
|
+
mock_mathml_italicise({ uppergreek: false, upperroman: true, lowergreek: true, lowerroman: true })
|
2284
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
2285
|
+
#{BLANK_HDR}
|
2286
|
+
<sections>
|
2287
|
+
<formula id='_'>
|
2288
|
+
<stem type='MathML'>
|
2289
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
2290
|
+
<mi>A</mi>
|
2291
|
+
<mo>+</mo>
|
2292
|
+
<mi>a</mi>
|
2293
|
+
<mo>+</mo>
|
2294
|
+
<mi mathvariant="normal">Α</mi>
|
2295
|
+
<mo>+</mo>
|
2296
|
+
<mi>α</mi>
|
2297
|
+
<mo>+</mo>
|
2298
|
+
<mi>AB</mi>
|
2299
|
+
<mstyle mathvariant='italic'>
|
2300
|
+
<mrow>
|
2332
2301
|
<mi>Α</mi>
|
2333
|
-
|
2334
|
-
|
2335
|
-
|
2336
|
-
|
2337
|
-
|
2338
|
-
|
2339
|
-
|
2340
|
-
|
2341
|
-
|
2342
|
-
|
2343
|
-
|
2344
|
-
|
2345
|
-
|
2346
|
-
|
2347
|
-
|
2348
|
-
|
2349
|
-
|
2350
|
-
|
2351
|
-
|
2352
|
-
|
2353
|
-
|
2354
|
-
|
2355
|
-
|
2356
|
-
|
2357
|
-
|
2358
|
-
|
2302
|
+
</mrow>
|
2303
|
+
</mstyle>
|
2304
|
+
</math>
|
2305
|
+
</stem>
|
2306
|
+
</formula>
|
2307
|
+
</sections>
|
2308
|
+
</standard-document>
|
2309
|
+
OUTPUT
|
2310
|
+
mock_mathml_italicise({ uppergreek: true, upperroman: false, lowergreek: true, lowerroman: true })
|
2311
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
2312
|
+
#{BLANK_HDR}
|
2313
|
+
<sections>
|
2314
|
+
<formula id='_'>
|
2315
|
+
<stem type='MathML'>
|
2316
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
2317
|
+
<mi mathvariant="normal">A</mi>
|
2318
|
+
<mo>+</mo>
|
2319
|
+
<mi>a</mi>
|
2320
|
+
<mo>+</mo>
|
2321
|
+
<mi>Α</mi>
|
2322
|
+
<mo>+</mo>
|
2323
|
+
<mi>α</mi>
|
2324
|
+
<mo>+</mo>
|
2325
|
+
<mi>AB</mi>
|
2326
|
+
<mstyle mathvariant='italic'>
|
2327
|
+
<mrow>
|
2359
2328
|
<mi>Α</mi>
|
2360
|
-
|
2361
|
-
|
2362
|
-
|
2363
|
-
|
2364
|
-
|
2365
|
-
|
2366
|
-
|
2367
|
-
|
2368
|
-
|
2369
|
-
|
2370
|
-
|
2371
|
-
|
2372
|
-
|
2373
|
-
|
2374
|
-
|
2375
|
-
|
2376
|
-
|
2377
|
-
|
2378
|
-
|
2379
|
-
|
2380
|
-
|
2381
|
-
|
2382
|
-
|
2383
|
-
|
2384
|
-
|
2385
|
-
|
2329
|
+
</mrow>
|
2330
|
+
</mstyle>
|
2331
|
+
</math>
|
2332
|
+
</stem>
|
2333
|
+
</formula>
|
2334
|
+
</sections>
|
2335
|
+
</standard-document>
|
2336
|
+
OUTPUT
|
2337
|
+
mock_mathml_italicise({ uppergreek: true, upperroman: true, lowergreek: false, lowerroman: true })
|
2338
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
2339
|
+
#{BLANK_HDR}
|
2340
|
+
<sections>
|
2341
|
+
<formula id='_'>
|
2342
|
+
<stem type='MathML'>
|
2343
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
2344
|
+
<mi>A</mi>
|
2345
|
+
<mo>+</mo>
|
2346
|
+
<mi>a</mi>
|
2347
|
+
<mo>+</mo>
|
2348
|
+
<mi>Α</mi>
|
2349
|
+
<mo>+</mo>
|
2350
|
+
<mi mathvariant="normal">α</mi>
|
2351
|
+
<mo>+</mo>
|
2352
|
+
<mi>AB</mi>
|
2353
|
+
<mstyle mathvariant='italic'>
|
2354
|
+
<mrow>
|
2386
2355
|
<mi>Α</mi>
|
2387
|
-
|
2388
|
-
|
2389
|
-
|
2390
|
-
|
2391
|
-
|
2392
|
-
|
2393
|
-
|
2394
|
-
|
2395
|
-
|
2396
|
-
|
2397
|
-
|
2398
|
-
|
2399
|
-
|
2400
|
-
|
2401
|
-
|
2402
|
-
|
2403
|
-
|
2404
|
-
|
2405
|
-
|
2356
|
+
</mrow>
|
2357
|
+
</mstyle>
|
2358
|
+
</math>
|
2359
|
+
</stem>
|
2360
|
+
</formula>
|
2361
|
+
</sections>
|
2362
|
+
</standard-document>
|
2363
|
+
OUTPUT
|
2364
|
+
mock_mathml_italicise({ uppergreek: true, upperroman: true, lowergreek: true, lowerroman: false })
|
2365
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
2366
|
+
#{BLANK_HDR}
|
2367
|
+
<sections>
|
2368
|
+
<formula id='_'>
|
2369
|
+
<stem type='MathML'>
|
2370
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
2371
|
+
<mi>A</mi>
|
2372
|
+
<mo>+</mo>
|
2373
|
+
<mi mathvariant="normal">a</mi>
|
2374
|
+
<mo>+</mo>
|
2375
|
+
<mi>Α</mi>
|
2376
|
+
<mo>+</mo>
|
2377
|
+
<mi>α</mi>
|
2378
|
+
<mo>+</mo>
|
2379
|
+
<mi>AB</mi>
|
2380
|
+
<mstyle mathvariant='italic'>
|
2381
|
+
<mrow>
|
2382
|
+
<mi>Α</mi>
|
2383
|
+
</mrow>
|
2384
|
+
</mstyle>
|
2385
|
+
</math>
|
2386
|
+
</stem>
|
2387
|
+
</formula>
|
2388
|
+
</sections>
|
2389
|
+
</standard-document>
|
2390
|
+
OUTPUT
|
2391
|
+
mock_mathml_italicise({ uppergreek: true, upperroman: true, lowergreek: true, lowerroman: true })
|
2392
|
+
end
|
2406
2393
|
|
2407
2394
|
it "process express_ref macro with existing bibliography" do
|
2408
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
2395
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
2409
2396
|
#{ASCIIDOC_BLANK_HDR}
|
2410
2397
|
== Clause
|
2411
2398
|
|
@@ -2425,50 +2412,49 @@ end
|
|
2425
2412
|
== Bibliography
|
2426
2413
|
* [[[D,E]]] F
|
2427
2414
|
INPUT
|
2428
|
-
|
2429
|
-
|
2430
|
-
|
2431
|
-
|
2432
|
-
|
2433
|
-
|
2434
|
-
|
2435
|
-
|
2436
|
-
|
2437
|
-
|
2438
|
-
|
2439
|
-
|
2440
|
-
|
2441
|
-
<xref target='action'>** Missing target action.AB</xref>
|
2442
|
-
|
2443
|
-
|
2444
|
-
|
2445
|
-
|
2446
|
-
|
2447
|
-
|
2448
|
-
|
2449
|
-
</clause>
|
2450
|
-
|
2451
|
-
|
2452
|
-
|
2453
|
-
|
2454
|
-
|
2455
|
-
|
2456
|
-
|
2457
|
-
|
2458
|
-
|
2459
|
-
|
2460
|
-
|
2461
|
-
|
2462
|
-
|
2463
|
-
|
2464
|
-
|
2465
|
-
</standard-document>
|
2415
|
+
#{BLANK_HDR}
|
2416
|
+
<sections>
|
2417
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2418
|
+
<title>Clause</title>
|
2419
|
+
<p id='_'>
|
2420
|
+
<eref bibitemid='uml_A' citeas="">
|
2421
|
+
<localityStack>
|
2422
|
+
<locality type='anchor'><referenceFrom>A.B.C</referenceFrom></locality>
|
2423
|
+
</localityStack>
|
2424
|
+
C
|
2425
|
+
</eref>
|
2426
|
+
<eref bibitemid='uml_A' citeas=""/>
|
2427
|
+
<xref target='action.AA'>AA</xref>
|
2428
|
+
<xref target='action'>** Missing target action.AB</xref>
|
2429
|
+
</p>
|
2430
|
+
</clause>
|
2431
|
+
<clause id='action' type='express-schema' inline-header='false' obligation='normative'>
|
2432
|
+
<title>Action</title>
|
2433
|
+
<clause id='action.AA' inline-header='false' obligation='normative'>
|
2434
|
+
<title>AA</title>
|
2435
|
+
</clause>
|
2436
|
+
</clause>
|
2437
|
+
</sections>
|
2438
|
+
<bibliography>
|
2439
|
+
<references id='_' normative='false' obligation='informative'>
|
2440
|
+
<title>Bibliography</title>
|
2441
|
+
<bibitem id='D'>
|
2442
|
+
<formattedref format='application/x-isodoc+xml'>F</formattedref>
|
2443
|
+
<docidentifier>E</docidentifier>
|
2444
|
+
</bibitem>
|
2445
|
+
</references>
|
2446
|
+
<references hidden='true' normative='false'>
|
2447
|
+
<bibitem id='uml_A' type='internal'>
|
2448
|
+
<docidentifier type='repository'>uml/A</docidentifier>
|
2449
|
+
</bibitem>
|
2450
|
+
</references>
|
2451
|
+
</bibliography>
|
2452
|
+
</standard-document>
|
2466
2453
|
OUTPUT
|
2467
2454
|
end
|
2468
2455
|
|
2469
|
-
|
2470
2456
|
it "process express_ref macro with no existing bibliography" do
|
2471
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
2457
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
2472
2458
|
#{ASCIIDOC_BLANK_HDR}
|
2473
2459
|
[[B]]
|
2474
2460
|
[type="express-schema"]
|
@@ -2482,159 +2468,156 @@ end
|
|
2482
2468
|
<<express-schema:B>>
|
2483
2469
|
<<express-schema:B1>>
|
2484
2470
|
INPUT
|
2485
|
-
|
2486
|
-
|
2487
|
-
|
2488
|
-
|
2489
|
-
|
2490
|
-
|
2491
|
-
|
2492
|
-
|
2493
|
-
|
2494
|
-
|
2495
|
-
|
2496
|
-
|
2497
|
-
|
2498
|
-
|
2499
|
-
|
2500
|
-
|
2501
|
-
|
2502
|
-
|
2503
|
-
|
2504
|
-
|
2505
|
-
|
2506
|
-
|
2507
|
-
|
2508
|
-
|
2509
|
-
|
2510
|
-
|
2511
|
-
|
2512
|
-
|
2513
|
-
|
2514
|
-
</standard-document>
|
2471
|
+
#{BLANK_HDR}
|
2472
|
+
<sections>
|
2473
|
+
<clause id='B' type='express-schema' inline-header='false' obligation='normative'>
|
2474
|
+
<title>Clause</title>
|
2475
|
+
<note id='B1'>
|
2476
|
+
<p id='_'>X</p>
|
2477
|
+
</note>
|
2478
|
+
<p id='_'>
|
2479
|
+
<eref bibitemid='express-schema_A' citeas=''>
|
2480
|
+
<localityStack>
|
2481
|
+
<locality type='anchor'>
|
2482
|
+
<referenceFrom>A.B.C</referenceFrom>
|
2483
|
+
</locality>
|
2484
|
+
</localityStack>
|
2485
|
+
C
|
2486
|
+
</eref>
|
2487
|
+
<eref bibitemid='express-schema_A' citeas=''/>
|
2488
|
+
<xref target='B'/>
|
2489
|
+
<xref target='B1'/>
|
2490
|
+
</p>
|
2491
|
+
</clause>
|
2492
|
+
</sections>
|
2493
|
+
<bibliography>
|
2494
|
+
<references hidden='true' normative='false'>
|
2495
|
+
<bibitem id='express-schema_A' type='internal'>
|
2496
|
+
<docidentifier type='repository'>express-schema/A</docidentifier>
|
2497
|
+
</bibitem>
|
2498
|
+
</references>
|
2499
|
+
</bibliography>
|
2500
|
+
</standard-document>
|
2515
2501
|
OUTPUT
|
2516
2502
|
end
|
2517
2503
|
|
2518
|
-
|
2519
2504
|
private
|
2520
2505
|
|
2521
2506
|
def mock_mathml_italicise(x)
|
2522
|
-
|
2507
|
+
allow_any_instance_of(::Asciidoctor::Standoc::Cleanup).to receive(:mathml_mi_italics).and_return(x)
|
2523
2508
|
end
|
2524
2509
|
|
2525
|
-
|
2526
|
-
|
2527
|
-
expect(Iecbib::IecBibliography).to receive(:get).with("IEC 60050-103", nil, {keep_year: true}) do
|
2510
|
+
def mock_iecbib_get_iec60050_103_01
|
2511
|
+
expect(Iecbib::IecBibliography).to receive(:get).with("IEC 60050-103", nil, { keep_year: true }) do
|
2528
2512
|
IsoBibItem::XMLParser.from_xml(<<~"OUTPUT")
|
2529
|
-
|
2530
|
-
|
2531
|
-
|
2532
|
-
|
2533
|
-
|
2534
|
-
|
2535
|
-
|
2536
|
-
|
2537
|
-
<organization>
|
2538
|
-
<name>International Electrotechnical Commission</name>
|
2539
|
-
<abbreviation>IEC</abbreviation>
|
2540
|
-
<uri>www.iec.ch</uri>
|
2541
|
-
</organization>
|
2542
|
-
</contributor>
|
2543
|
-
<language>en</language>
|
2544
|
-
<language>fr</language>
|
2545
|
-
<script>Latn</script>
|
2546
|
-
<status>
|
2547
|
-
<stage>60</stage>
|
2548
|
-
</status>
|
2549
|
-
<copyright>
|
2550
|
-
<from>2018</from>
|
2551
|
-
<owner>
|
2513
|
+
<bibitem type="standard" id="IEC60050-103">
|
2514
|
+
<title format="text/plain" language="en" script="Latn">International Electrotechnical Vocabulary</title>
|
2515
|
+
<docidentifier>IEC 60050-103:2009</docidentifier>
|
2516
|
+
<date type="published">
|
2517
|
+
<on>2009</on>
|
2518
|
+
</date>
|
2519
|
+
<contributor>
|
2520
|
+
<role type="publisher"/>
|
2552
2521
|
<organization>
|
2553
2522
|
<name>International Electrotechnical Commission</name>
|
2554
2523
|
<abbreviation>IEC</abbreviation>
|
2555
2524
|
<uri>www.iec.ch</uri>
|
2556
2525
|
</organization>
|
2557
|
-
</
|
2558
|
-
|
2559
|
-
|
2560
|
-
|
2526
|
+
</contributor>
|
2527
|
+
<language>en</language>
|
2528
|
+
<language>fr</language>
|
2529
|
+
<script>Latn</script>
|
2530
|
+
<status>
|
2531
|
+
<stage>60</stage>
|
2532
|
+
</status>
|
2533
|
+
<copyright>
|
2534
|
+
<from>2018</from>
|
2535
|
+
<owner>
|
2536
|
+
<organization>
|
2537
|
+
<name>International Electrotechnical Commission</name>
|
2538
|
+
<abbreviation>IEC</abbreviation>
|
2539
|
+
<uri>www.iec.ch</uri>
|
2540
|
+
</organization>
|
2541
|
+
</owner>
|
2542
|
+
</copyright>
|
2543
|
+
</bibitem>
|
2544
|
+
OUTPUT
|
2561
2545
|
end
|
2562
|
-
end
|
2546
|
+
end
|
2563
2547
|
|
2564
|
-
|
2565
|
-
|
2548
|
+
def mock_iecbib_get_iec60050_102_01
|
2549
|
+
expect(Iecbib::IecBibliography).to receive(:get).with("IEC 60050-102", nil, { keep_year: true }) do
|
2566
2550
|
IsoBibItem::XMLParser.from_xml(<<~"OUTPUT")
|
2567
|
-
|
2568
|
-
|
2569
|
-
|
2570
|
-
|
2571
|
-
|
2572
|
-
|
2573
|
-
|
2574
|
-
|
2575
|
-
<organization>
|
2576
|
-
<name>International Electrotechnical Commission</name>
|
2577
|
-
<abbreviation>IEC</abbreviation>
|
2578
|
-
<uri>www.iec.ch</uri>
|
2579
|
-
</organization>
|
2580
|
-
</contributor>
|
2581
|
-
<language>en</language>
|
2582
|
-
<language>fr</language>
|
2583
|
-
<script>Latn</script>
|
2584
|
-
<status>
|
2585
|
-
<stage>60</stage>
|
2586
|
-
</status>
|
2587
|
-
<copyright>
|
2588
|
-
<from>2018</from>
|
2589
|
-
<owner>
|
2551
|
+
<bibitem type="standard" id="IEC60050-102">
|
2552
|
+
<title format="text/plain" language="en" script="Latn">International Electrotechnical Vocabulary</title>
|
2553
|
+
<docidentifier>IEC 60050-102:2007</docidentifier>
|
2554
|
+
<date type="published">
|
2555
|
+
<on>2007</on>
|
2556
|
+
</date>
|
2557
|
+
<contributor>
|
2558
|
+
<role type="publisher"/>
|
2590
2559
|
<organization>
|
2591
2560
|
<name>International Electrotechnical Commission</name>
|
2592
2561
|
<abbreviation>IEC</abbreviation>
|
2593
2562
|
<uri>www.iec.ch</uri>
|
2594
2563
|
</organization>
|
2595
|
-
</
|
2596
|
-
|
2597
|
-
|
2598
|
-
|
2564
|
+
</contributor>
|
2565
|
+
<language>en</language>
|
2566
|
+
<language>fr</language>
|
2567
|
+
<script>Latn</script>
|
2568
|
+
<status>
|
2569
|
+
<stage>60</stage>
|
2570
|
+
</status>
|
2571
|
+
<copyright>
|
2572
|
+
<from>2018</from>
|
2573
|
+
<owner>
|
2574
|
+
<organization>
|
2575
|
+
<name>International Electrotechnical Commission</name>
|
2576
|
+
<abbreviation>IEC</abbreviation>
|
2577
|
+
<uri>www.iec.ch</uri>
|
2578
|
+
</organization>
|
2579
|
+
</owner>
|
2580
|
+
</copyright>
|
2581
|
+
</bibitem>
|
2582
|
+
OUTPUT
|
2599
2583
|
end
|
2600
|
-
end
|
2584
|
+
end
|
2601
2585
|
|
2602
|
-
|
2603
|
-
|
2586
|
+
def mock_iev
|
2587
|
+
expect(Iecbib::IecBibliography).to receive(:get).with("IEV", nil, {}) do
|
2604
2588
|
IsoBibItem::XMLParser.from_xml(<<~"OUTPUT")
|
2605
|
-
|
2606
|
-
|
2607
|
-
|
2608
|
-
|
2609
|
-
|
2610
|
-
|
2611
|
-
|
2612
|
-
|
2613
|
-
<organization>
|
2614
|
-
<name>International Electrotechnical Commission</name>
|
2615
|
-
<abbreviation>IEC</abbreviation>
|
2616
|
-
<uri>www.iec.ch</uri>
|
2617
|
-
</organization>
|
2618
|
-
</contributor>
|
2619
|
-
<language>en</language>
|
2620
|
-
<language>fr</language>
|
2621
|
-
<script>Latn</script>
|
2622
|
-
<status>
|
2623
|
-
<stage>60</stage>
|
2624
|
-
</status>
|
2625
|
-
<copyright>
|
2626
|
-
<from>2018</from>
|
2627
|
-
<owner>
|
2589
|
+
<bibitem type="standard" id="IEC60050:2001">
|
2590
|
+
<title format="text/plain" language="en" script="Latn">International Electrotechnical Vocabulary</title>
|
2591
|
+
<docidentifier>IEC 60050:2011</docidentifier>
|
2592
|
+
<date type="published">
|
2593
|
+
<on>2007</on>
|
2594
|
+
</date>
|
2595
|
+
<contributor>
|
2596
|
+
<role type="publisher"/>
|
2628
2597
|
<organization>
|
2629
2598
|
<name>International Electrotechnical Commission</name>
|
2630
2599
|
<abbreviation>IEC</abbreviation>
|
2631
2600
|
<uri>www.iec.ch</uri>
|
2632
2601
|
</organization>
|
2633
|
-
</
|
2634
|
-
|
2635
|
-
|
2636
|
-
|
2602
|
+
</contributor>
|
2603
|
+
<language>en</language>
|
2604
|
+
<language>fr</language>
|
2605
|
+
<script>Latn</script>
|
2606
|
+
<status>
|
2607
|
+
<stage>60</stage>
|
2608
|
+
</status>
|
2609
|
+
<copyright>
|
2610
|
+
<from>2018</from>
|
2611
|
+
<owner>
|
2612
|
+
<organization>
|
2613
|
+
<name>International Electrotechnical Commission</name>
|
2614
|
+
<abbreviation>IEC</abbreviation>
|
2615
|
+
<uri>www.iec.ch</uri>
|
2616
|
+
</organization>
|
2617
|
+
</owner>
|
2618
|
+
</copyright>
|
2619
|
+
</bibitem>
|
2620
|
+
OUTPUT
|
2637
2621
|
end.at_least :once
|
2638
|
-
end
|
2639
|
-
|
2622
|
+
end
|
2640
2623
|
end
|