metanorma-standoc 1.8.8 → 1.9.0

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