metanorma-standoc 1.8.4 → 1.9.0

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