metanorma-standoc 1.8.2 → 1.8.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/rake.yml +11 -41
  3. data/.gitignore +2 -0
  4. data/.rubocop.yml +6 -2
  5. data/lib/asciidoctor/standoc/base.rb +3 -1
  6. data/lib/asciidoctor/standoc/biblio.rng +4 -6
  7. data/lib/asciidoctor/standoc/blocks.rb +35 -12
  8. data/lib/asciidoctor/standoc/cleanup.rb +2 -1
  9. data/lib/asciidoctor/standoc/cleanup_block.rb +73 -22
  10. data/lib/asciidoctor/standoc/cleanup_boilerplate.rb +3 -3
  11. data/lib/asciidoctor/standoc/cleanup_inline.rb +4 -3
  12. data/lib/asciidoctor/standoc/cleanup_maths.rb +37 -0
  13. data/lib/asciidoctor/standoc/cleanup_ref.rb +4 -13
  14. data/lib/asciidoctor/standoc/cleanup_section.rb +5 -0
  15. data/lib/asciidoctor/standoc/cleanup_terms.rb +2 -2
  16. data/lib/asciidoctor/standoc/inline.rb +7 -15
  17. data/lib/asciidoctor/standoc/isodoc.rng +105 -2
  18. data/lib/asciidoctor/standoc/ref_sect.rb +12 -12
  19. data/lib/asciidoctor/standoc/section.rb +9 -0
  20. data/lib/asciidoctor/standoc/utils.rb +0 -24
  21. data/lib/asciidoctor/standoc/validate.rb +16 -1
  22. data/lib/metanorma/standoc/version.rb +1 -1
  23. data/metanorma-standoc.gemspec +5 -5
  24. data/spec/{asciidoctor-standoc → asciidoctor}/base_spec.rb +4 -0
  25. data/spec/{asciidoctor-standoc → asciidoctor}/blocks_spec.rb +0 -0
  26. data/spec/{asciidoctor-standoc → asciidoctor}/cleanup_sections_spec.rb +14 -14
  27. data/spec/{asciidoctor-standoc → asciidoctor}/cleanup_spec.rb +242 -11
  28. data/spec/{asciidoctor-standoc → asciidoctor}/datamodel/attributes_table_preprocessor_spec.rb +0 -0
  29. data/spec/{asciidoctor-standoc → asciidoctor}/datamodel/diagram_preprocessor_spec.rb +0 -0
  30. data/spec/{asciidoctor-standoc → asciidoctor}/inline_spec.rb +2 -0
  31. data/spec/{asciidoctor-standoc → asciidoctor}/isobib_cache_spec.rb +0 -0
  32. data/spec/{asciidoctor-standoc → asciidoctor}/lists_spec.rb +0 -0
  33. data/spec/{asciidoctor-standoc → asciidoctor}/macros_json2text_spec.rb +0 -0
  34. data/spec/{asciidoctor-standoc → asciidoctor}/macros_plantuml_spec.rb +0 -0
  35. data/spec/{asciidoctor-standoc → asciidoctor}/macros_spec.rb +0 -0
  36. data/spec/{asciidoctor-standoc → asciidoctor}/macros_yaml2text_spec.rb +0 -0
  37. data/spec/{asciidoctor-standoc → asciidoctor}/refs_dl_spec.rb +0 -0
  38. data/spec/{asciidoctor-standoc → asciidoctor}/refs_spec.rb +297 -147
  39. data/spec/{asciidoctor-standoc → asciidoctor}/section_spec.rb +17 -0
  40. data/spec/{asciidoctor-standoc → asciidoctor}/table_spec.rb +0 -0
  41. data/spec/{asciidoctor-standoc → asciidoctor}/validate_spec.rb +20 -0
  42. data/spec/assets/html-override.css +1 -0
  43. data/spec/assets/word-override.css +1 -0
  44. data/spec/fixtures/action_schemaexpg1.svg +122 -0
  45. data/spec/spec_helper.rb +8 -0
  46. data/spec/vcr_cassettes/dated_iso_ref_joint_iso_iec.yml +62 -62
  47. data/spec/vcr_cassettes/isobib_get_123.yml +15 -15
  48. data/spec/vcr_cassettes/isobib_get_123_1.yml +30 -30
  49. data/spec/vcr_cassettes/isobib_get_123_1_fr.yml +42 -42
  50. data/spec/vcr_cassettes/isobib_get_123_2001.yml +15 -15
  51. data/spec/vcr_cassettes/isobib_get_124.yml +16 -16
  52. data/spec/vcr_cassettes/rfcbib_get_rfc8341.yml +94 -30
  53. data/spec/vcr_cassettes/separates_iev_citations_by_top_level_clause.yml +59 -57
  54. metadata +41 -41
  55. data/.rubocop.ribose.yml +0 -66
  56. data/.rubocop.tb.yml +0 -650
  57. data/spec/asciidoctor-standoc/macros_lutaml_spec.rb +0 -80
@@ -35,10 +35,25 @@ module Asciidoctor
35
35
 
36
36
  def content_validate(doc)
37
37
  section_validate(doc)
38
+ norm_ref_validate(doc)
38
39
  repeat_id_validate(doc.root)
39
40
  iev_validate(doc.root)
40
41
  end
41
42
 
43
+ def norm_ref_validate(doc)
44
+ found = false
45
+ doc.xpath("//references[@normative = 'true']/bibitem").each do |b|
46
+ next unless docid = b.at("./docidentifier[@type = 'metanorma']")
47
+ next unless /^\[\d+\]$/.match(docid.text)
48
+ @log.add("Bibliography", b, "Numeric reference in normative references")
49
+ found = true
50
+ end
51
+ if found
52
+ clean_exit
53
+ abort("Numeric reference in normative references")
54
+ end
55
+ end
56
+
42
57
  def repeat_id_validate1(ids, x)
43
58
  if ids[x["id"]]
44
59
  @log.add("Anchors", x, "Anchor #{x['id']} has already been used "\
@@ -89,7 +104,7 @@ module Asciidoctor
89
104
  def formattedstr_strip(doc)
90
105
  doc.xpath("//*[@format] | //stem | //bibdata//description | "\
91
106
  "//formattedref | //bibdata//note | //bibdata/abstract | "\
92
- "//bibitem/abstract | //bibitem/note").each do |n|
107
+ "//bibitem/abstract | //bibitem/note | //misc-container").each do |n|
93
108
  n.elements.each do |e|
94
109
  e.traverse do |e1|
95
110
  e1.element? and e1.each { |k, _v| e1.delete(k) }
@@ -19,6 +19,6 @@ module Metanorma
19
19
  end
20
20
 
21
21
  module Standoc
22
- VERSION= "1.8.2".freeze
22
+ VERSION= "1.8.7".freeze
23
23
  end
24
24
  end
@@ -31,25 +31,25 @@ Gem::Specification.new do |spec|
31
31
  spec.add_dependency "isodoc", "~> 1.5.0"
32
32
  spec.add_dependency "iev", "~> 0.2.1"
33
33
  spec.add_dependency "metanorma-plugin-datastruct"
34
- spec.add_dependency "metanorma-plugin-lutaml", "~> 0.2.1"
34
+ spec.add_dependency "metanorma-plugin-lutaml", "~> 0.3.0"
35
35
  # relaton-cli not just relaton, to avoid circular reference in metanorma
36
36
  spec.add_dependency "relaton-cli", "~> 1.7.0"
37
37
  spec.add_dependency "relaton-iev", "~> 1.1.0"
38
38
  spec.add_dependency "concurrent-ruby"
39
39
  spec.add_dependency "unicode2latex", "~> 0.0.1"
40
- spec.add_dependency "metanorma-utils", "~> 1"
41
- spec.add_dependency "mimemagic"
40
+ spec.add_dependency "metanorma-utils", "~> 1.0.2"
42
41
  spec.add_dependency "mathml2asciimath"
43
42
  spec.add_dependency "latexmath"
43
+ spec.add_dependency "asciimath2unitsml", "~> 0.3.0"
44
44
 
45
45
  spec.add_development_dependency "byebug"
46
46
  spec.add_development_dependency "sassc", "2.4.0"
47
47
  spec.add_development_dependency "equivalent-xml", "~> 0.6"
48
48
  spec.add_development_dependency "guard", "~> 2.14"
49
49
  spec.add_development_dependency "guard-rspec", "~> 4.7"
50
- spec.add_development_dependency "rake", "~> 12.0"
50
+ spec.add_development_dependency "rake", "~> 13.0"
51
51
  spec.add_development_dependency "rspec", "~> 3.6"
52
- spec.add_development_dependency "rubocop", "= 0.54.0"
52
+ spec.add_development_dependency "rubocop", "~> 1.5.2"
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,6 +761,7 @@ 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
766
  expect(html).to include(%[Content-Location: file:///C:/Doc/test_files/header.html
763
767
  Content-Transfer-Encoding: base64
@@ -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,6 +3,108 @@ require "relaton_iec"
3
3
  require "fileutils"
4
4
 
5
5
  RSpec.describe Asciidoctor::Standoc do
6
+ it "processes svgmap" do
7
+ FileUtils.cp "spec/fixtures/action_schemaexpg1.svg", "action_schemaexpg1.svg"
8
+ FileUtils.cp "spec/fixtures/action_schemaexpg1.svg", "action_schemaexpg2.svg"
9
+ expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
10
+ #{ASCIIDOC_BLANK_HDR}
11
+
12
+ [svgmap%unnumbered,number=8,subsequence=A,keep-with-next=true,keep-lines-together=true]
13
+ ====
14
+ * <<ref1,Computer>>; http://www.example.com
15
+ ====
16
+
17
+ [[ref1]]
18
+ .SVG title
19
+ [.svgmap]
20
+ ====
21
+ image::action_schemaexpg1.svg[]
22
+
23
+ * <<ref1,Computer>>; mn://action_schema
24
+ * http://www.example.com[Phone]; http://www.example.com
25
+ ====
26
+
27
+ [[ref2]]
28
+ [svgmap%unnumbered,number=8,subsequence=A,keep-with-next=true,keep-lines-together=true]
29
+ ====
30
+ [alt=Workmap]
31
+ image::action_schemaexpg2.svg[]
32
+
33
+ * <<ref1,Computer>>; href1.htm
34
+ * http://www.example.com[Phone]; mn://basic_attribute_schema
35
+ * <<express:action_schema:action_schema.basic,Coffee>>; mn://support_resource_schema
36
+ ====
37
+ INPUT
38
+ #{BLANK_HDR}
39
+ <sections>
40
+ <svgmap unnumbered='true' number='8' subsequence='A' keep-with-next='true' keep-lines-together='true'>
41
+ <target href='http://www.example.com'>
42
+ <xref target='ref1'>Computer</xref>
43
+ </target>
44
+ </svgmap>
45
+ <figure id='ref1'>
46
+ <name>SVG title</name>
47
+ <image src='action_schemaexpg1.svg' id='_' mimetype='image/svg+xml' height='auto' width='auto'/>
48
+ </figure>
49
+ <svgmap>
50
+ <figure id='ref2' unnumbered='true' number='8' subsequence='A' keep-with-next='true' keep-lines-together='true'>
51
+ <image src='action_schemaexpg2.svg' id='_' mimetype='image/svg+xml' height='auto' width='auto' alt='Workmap'/>
52
+ </figure>
53
+ <target href='mn://support_resource_schema'>
54
+ <eref bibitemid='express_action_schema' citeas=''>
55
+ <localityStack>
56
+ <locality type='anchor'>
57
+ <referenceFrom>action_schema.basic</referenceFrom>
58
+ </locality>
59
+ </localityStack>
60
+ Coffee
61
+ </eref>
62
+ </target>
63
+ </svgmap>
64
+ </sections>
65
+ <bibliography>
66
+ <references hidden='true' normative='false'>
67
+ <bibitem id='express_action_schema' type='internal'>
68
+ <docidentifier type='repository'>express/action_schema</docidentifier>
69
+ </bibitem>
70
+ </references>
71
+ </bibliography>
72
+ </standard-document>
73
+ OUTPUT
74
+ expect(xmlpp(File.read("action_schemaexpg1.svg", encoding: "utf-8").sub(%r{<image .*</image>}m, ""))).to be_equivalent_to <<~OUTPUT
75
+ <?xml version='1.0' encoding='UTF-8'?>
76
+ <!-- Generator: Adobe Illustrator 25.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
77
+ <svg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' version='1.1' id='Layer_1' x='0px' y='0px' viewBox='0 0 595.28 841.89' style='enable-background:new 0 0 595.28 841.89;' xml:space='preserve'>
78
+ <style type='text/css'> .st0{fill:none;stroke:#000000;stroke-miterlimit:10;} </style>
79
+ <a xlink:href='#ref1'>
80
+ <rect x='123.28' y='273.93' class='st0' width='88.05' height='41.84'/>
81
+ </a>
82
+ <a xlink:href='mn://basic_attribute_schema'>
83
+ <rect x='324.69' y='450.52' class='st0' width='132.62' height='40.75'/>
84
+ </a>
85
+ <a xlink:href='mn://support_resource_schema'>
86
+ <rect x='324.69' y='528.36' class='st0' width='148.16' height='40.75'/>
87
+ </a>
88
+ </svg>
89
+ OUTPUT
90
+ expect(xmlpp(File.read("action_schemaexpg2.svg", encoding: "utf-8").sub(%r{<image .*</image>}m, ""))).to be_equivalent_to <<~OUTPUT
91
+ <?xml version='1.0' encoding='UTF-8'?>
92
+ <!-- Generator: Adobe Illustrator 25.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
93
+ <svg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' version='1.1' id='Layer_1' x='0px' y='0px' viewBox='0 0 595.28 841.89' style='enable-background:new 0 0 595.28 841.89;' xml:space='preserve'>
94
+ <style type='text/css'> .st0{fill:none;stroke:#000000;stroke-miterlimit:10;} </style>
95
+ <a xlink:href='mn://action_schema'>
96
+ <rect x='123.28' y='273.93' class='st0' width='88.05' height='41.84'/>
97
+ </a>
98
+ <a xlink:href='http://www.example.com'>
99
+ <rect x='324.69' y='450.52' class='st0' width='132.62' height='40.75'/>
100
+ </a>
101
+ <a xlink:href='mn://support_resource_schema'>
102
+ <rect x='324.69' y='528.36' class='st0' width='148.16' height='40.75'/>
103
+ </a>
104
+ </svg>
105
+ OUTPUT
106
+ end
107
+
6
108
  it "processes markup in sourcecode" do
7
109
  expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
8
110
  #{ASCIIDOC_BLANK_HDR}
@@ -1249,7 +1351,7 @@ RSpec.describe Asciidoctor::Standoc do
1249
1351
  <abstract format="text/plain" language="en" script="Latn">This part of IEC 60050 gives the general mathematical terminology used in the fields of electricity, electronics and telecommunications, together with basic concepts in linear algebra. It maintains a clear distinction between mathematical concepts and physical concepts, even if some terms are used in both cases. Another part will deal with functions.&#13; It has the status of a horizontal standard in accordance with IEC Guide 108.</abstract>
1250
1352
  <status>
1251
1353
  <stage>60</stage>
1252
- <substage>60</substage>
1354
+ <substage>00</substage>
1253
1355
  </status>
1254
1356
  <copyright>
1255
1357
  <from>2007</from>
@@ -1662,7 +1764,7 @@ it "sorts symbols lists" do
1662
1764
  == Symbols and abbreviated terms
1663
1765
 
1664
1766
  α:: Definition 1
1665
- xa:: Definition 2
1767
+ Xa:: Definition 2
1666
1768
  x_1_:: Definition 3
1667
1769
  x_m_:: Definition 4
1668
1770
  x:: Definition 5
@@ -1700,7 +1802,7 @@ it "sorts symbols lists" do
1700
1802
  <dd>
1701
1803
  <p id='_'>Definition 3</p>
1702
1804
  </dd>
1703
- <dt>xa</dt>
1805
+ <dt>Xa</dt>
1704
1806
  <dd>
1705
1807
  <p id='_'>Definition 2</p>
1706
1808
  </dd>
@@ -2019,6 +2121,123 @@ expect(xmlpp(Asciidoctor.convert(input, backend: :standoc, header_footer: true))
2019
2121
  OUTPUT
2020
2122
 
2021
2123
  end
2124
+
2125
+ it "converts UnitsML to MathML" do
2126
+ expect(xmlpp(strip_guid(Asciidoctor.convert(<<~INPUT, backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
2127
+ = Document title
2128
+ Author
2129
+ :stem:
2130
+
2131
+ [stem]
2132
+ ++++
2133
+ <math xmlns='http://www.w3.org/1998/Math/MathML'>
2134
+ <mrow>
2135
+ <mn>7</mn>
2136
+ <mtext>unitsml(m*kg^-2)</mtext>
2137
+ <mo>+</mo>
2138
+ <mn>8</mn>
2139
+ <mtext>unitsml(m*kg^-2)</mtext>
2140
+ </mrow>
2141
+ </math>
2142
+ ++++
2143
+ INPUT
2144
+ #{BLANK_HDR}
2145
+ <misc-container>
2146
+ <UnitsML xmlns='https://schema.unitsml.org/unitsml/1.0'>
2147
+ <UnitSet>
2148
+ <Unit xml:id='U_m.kg-2' dimensionURL='#D_LM-2'>
2149
+ <UnitSystem name='SI' type='SI_derived' xml:lang='en-US'/>
2150
+ <UnitName xml:lang='en'>m*kg^-2</UnitName>
2151
+ <UnitSymbol type='HTML'>
2152
+ m&#160;kg
2153
+ <sup>&#8722;2</sup>
2154
+ </UnitSymbol>
2155
+ <UnitSymbol type='MathML'>
2156
+ <math xmlns='http://www.w3.org/1998/Math/MathML'>
2157
+ <mrow>
2158
+ <mi mathvariant='normal'>m</mi>
2159
+ <mo rspace='thickmathspace'>&#8290;</mo>
2160
+ <msup>
2161
+ <mrow>
2162
+ <mi mathvariant='normal'>kg</mi>
2163
+ </mrow>
2164
+ <mrow>
2165
+ <mo>&#8722;</mo>
2166
+ <mn>2</mn>
2167
+ </mrow>
2168
+ </msup>
2169
+ </mrow>
2170
+ </math>
2171
+ </UnitSymbol>
2172
+ <RootUnits>
2173
+ <EnumeratedRootUnit unit='meter'/>
2174
+ <EnumeratedRootUnit unit='gram' prefix='k' powerNumerator='-2'/>
2175
+ </RootUnits>
2176
+ </Unit>
2177
+ </UnitSet>
2178
+ <DimensionSet>
2179
+ <Dimension xml:id='D_LM-2'>
2180
+ <Length symbol='L' powerNumerator='1'/>
2181
+ <Mass symbol='M' powerNumerator='-2'/>
2182
+ </Dimension>
2183
+ </DimensionSet>
2184
+ <PrefixSet>
2185
+ <Prefix prefixBase='10' prefixPower='3' xml:id='NISTp10_3'>
2186
+ <PrefixName xml:lang='en'>kilo</PrefixName>
2187
+ <PrefixSymbol type='ASCII'>k</PrefixSymbol>
2188
+ <PrefixSymbol type='unicode'>k</PrefixSymbol>
2189
+ <PrefixSymbol type='LaTeX'>k</PrefixSymbol>
2190
+ <PrefixSymbol type='HTML'>k</PrefixSymbol>
2191
+ </Prefix>
2192
+ </PrefixSet>
2193
+ </UnitsML>
2194
+ </misc-container>
2195
+ <sections>
2196
+ <formula id='_'>
2197
+ <stem type='MathML'>
2198
+ <math xmlns='http://www.w3.org/1998/Math/MathML'>
2199
+ <mrow>
2200
+ <mn>7</mn>
2201
+ <mo rspace='thickmathspace'>&#8290;</mo>
2202
+ <mrow xref='U_m.kg-2'>
2203
+ <mi mathvariant='normal'>m</mi>
2204
+ <mo rspace='thickmathspace'>&#8290;</mo>
2205
+ <msup>
2206
+ <mrow>
2207
+ <mi mathvariant='normal'>kg</mi>
2208
+ </mrow>
2209
+ <mrow>
2210
+ <mo>&#8722;</mo>
2211
+ <mn>2</mn>
2212
+ </mrow>
2213
+ </msup>
2214
+ </mrow>
2215
+ <mo>+</mo>
2216
+ <mn>8</mn>
2217
+ <mo rspace='thickmathspace'>&#8290;</mo>
2218
+ <mrow xref='U_m.kg-2'>
2219
+ <mi mathvariant='normal'>m</mi>
2220
+ <mo rspace='thickmathspace'>&#8290;</mo>
2221
+ <msup>
2222
+ <mrow>
2223
+ <mi mathvariant='normal'>kg</mi>
2224
+ </mrow>
2225
+ <mrow>
2226
+ <mo>&#8722;</mo>
2227
+ <mn>2</mn>
2228
+ </mrow>
2229
+ </msup>
2230
+ </mrow>
2231
+ </mrow>
2232
+ </math>
2233
+ </stem>
2234
+ </formula>
2235
+ </sections>
2236
+ </standard-document>
2237
+ OUTPUT
2238
+
2239
+ end
2240
+
2022
2241
  it "customises italicisation of MathML" do
2023
2242
  input = <<~INPUT
2024
2243
  = Document title
@@ -2251,23 +2470,37 @@ end
2251
2470
  it "process express_ref macro with no existing bibliography" do
2252
2471
  expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true, agree_to_terms: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
2253
2472
  #{ASCIIDOC_BLANK_HDR}
2473
+ [[B]]
2474
+ [type="express-schema"]
2254
2475
  == Clause
2255
2476
 
2477
+ [[B1]]
2478
+ NOTE: X
2479
+
2256
2480
  <<express-schema:A:A.B.C,C>>
2257
2481
  <<express-schema:A>>
2482
+ <<express-schema:B>>
2483
+ <<express-schema:B1>>
2258
2484
  INPUT
2259
2485
  #{BLANK_HDR}
2260
2486
  <sections>
2261
- <clause id='_' inline-header='false' obligation='normative'>
2487
+ <clause id='B' type='express-schema' inline-header='false' obligation='normative'>
2262
2488
  <title>Clause</title>
2489
+ <note id='B1'>
2490
+ <p id='_'>X</p>
2491
+ </note>
2263
2492
  <p id='_'>
2264
- <eref bibitemid='express-schema_A' citeas="">
2265
- <localityStack>
2266
- <locality type='anchor'><referenceFrom>A.B.C</referenceFrom></locality>
2267
- </localityStack>
2493
+ <eref bibitemid='express-schema_A' citeas=''>
2494
+ <localityStack>
2495
+ <locality type='anchor'>
2496
+ <referenceFrom>A.B.C</referenceFrom>
2497
+ </locality>
2498
+ </localityStack>
2268
2499
  C
2269
2500
  </eref>
2270
- <eref bibitemid='express-schema_A' citeas=""/>
2501
+ <eref bibitemid='express-schema_A' citeas=''/>
2502
+ <xref target='B'/>
2503
+ <xref target='B1'/>
2271
2504
  </p>
2272
2505
  </clause>
2273
2506
  </sections>
@@ -2404,6 +2637,4 @@ OUTPUT
2404
2637
  end.at_least :once
2405
2638
  end
2406
2639
 
2407
-
2408
-
2409
2640
  end