metanorma-standoc 1.5.3 → 1.6.0

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 (35) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/macos.yml +4 -9
  3. data/.github/workflows/ubuntu.yml +0 -4
  4. data/.github/workflows/windows.yml +2 -12
  5. data/lib/asciidoctor/standoc/base.rb +6 -1
  6. data/lib/asciidoctor/standoc/basicdoc.rng +4 -11
  7. data/lib/asciidoctor/standoc/cleanup.rb +30 -12
  8. data/lib/asciidoctor/standoc/cleanup_ref.rb +2 -3
  9. data/lib/asciidoctor/standoc/front_contributor.rb +10 -2
  10. data/lib/asciidoctor/standoc/inline.rb +18 -40
  11. data/lib/asciidoctor/standoc/isodoc.rng +13 -6
  12. data/lib/asciidoctor/standoc/json2_text_preprocessor.rb +2 -1
  13. data/lib/asciidoctor/standoc/ref.rb +31 -30
  14. data/lib/asciidoctor/standoc/yaml2_text_preprocessor.rb +4 -1
  15. data/lib/metanorma/standoc.rb +0 -5
  16. data/lib/metanorma/standoc/version.rb +20 -1
  17. data/metanorma-standoc.gemspec +2 -1
  18. data/spec/asciidoctor-standoc/base_spec.rb +121 -3
  19. data/spec/asciidoctor-standoc/blocks_spec.rb +1 -1
  20. data/spec/asciidoctor-standoc/cleanup_spec.rb +11 -9
  21. data/spec/asciidoctor-standoc/inline_spec.rb +128 -4
  22. data/spec/asciidoctor-standoc/isobib_cache_spec.rb +9 -7
  23. data/spec/asciidoctor-standoc/refs_spec.rb +27 -18
  24. data/spec/spec_helper.rb +1 -1
  25. data/spec/support/shared_examples/structured_data_2_text_preprocessor.rb +46 -0
  26. data/spec/vcr_cassettes/dated_iso_ref_joint_iso_iec.yml +71 -71
  27. data/spec/vcr_cassettes/isobib_get_123.yml +17 -17
  28. data/spec/vcr_cassettes/isobib_get_123_1.yml +35 -35
  29. data/spec/vcr_cassettes/isobib_get_123_2001.yml +18 -18
  30. data/spec/vcr_cassettes/isobib_get_124.yml +17 -17
  31. data/spec/vcr_cassettes/rfcbib_get_rfc8341.yml +8 -8
  32. data/spec/vcr_cassettes/separates_iev_citations_by_top_level_clause.yml +39 -37
  33. metadata +5 -7
  34. data/lib/metanorma/standoc/latexml_requirement.rb +0 -62
  35. data/lib/metanorma/standoc/requirement.rb +0 -13
@@ -36,7 +36,10 @@ module Asciidoctor
36
36
  protected
37
37
 
38
38
  def content_from_file(document, file_path)
39
- YAML.safe_load(File.read(relative_file_path(document, file_path)))
39
+ YAML.safe_load(
40
+ File.read(relative_file_path(document, file_path),
41
+ encoding: "UTF-8"),
42
+ [Date, Time])
40
43
  end
41
44
  end
42
45
  end
@@ -1,11 +1,6 @@
1
1
  require_relative "./standoc/processor"
2
- require_relative "./standoc/requirement"
3
- require_relative "./standoc/latexml_requirement"
4
2
 
5
3
  module Metanorma
6
4
  module Standoc
7
- Requirements = {
8
- latexml: LatexmlRequirement.new
9
- }
10
5
  end
11
6
  end
@@ -1,5 +1,24 @@
1
1
  module Metanorma
2
+ class << self
3
+ # https://stackoverflow.com/a/53399471
4
+ def parent_of(mod)
5
+ parent_name = mod.name =~ /::[^:]+\Z/ ? $`.freeze : nil
6
+ Object.const_get(parent_name) if parent_name
7
+ end
8
+
9
+ def all_modules(mod)
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) }
13
+ end
14
+
15
+ def versioned(mod, flavour)
16
+ all_modules(mod).select {|c| defined? c::VERSION}.
17
+ select {|c| c.name =~ /::#{flavour}$/ }
18
+ end
19
+ end
20
+
2
21
  module Standoc
3
- VERSION = "1.5.3".freeze
22
+ VERSION = "1.6.0".freeze
4
23
  end
5
24
  end
@@ -30,7 +30,8 @@ Gem::Specification.new do |spec|
30
30
  spec.add_dependency "ruby-jing"
31
31
  spec.add_dependency "isodoc", "~> 1.2.0"
32
32
  spec.add_dependency "iev", "~> 0.2.1"
33
- spec.add_dependency "relaton", "~> 1.3.0"
33
+ # relaton-cli not just relaton, to avoid circular reference in metanorma
34
+ spec.add_dependency "relaton-cli", "~> 1.4.0"
34
35
  spec.add_dependency "relaton-iev", "~> 1.0.0"
35
36
  spec.add_dependency "sterile", "~> 1.0.14"
36
37
  spec.add_dependency "concurrent-ruby"
@@ -32,8 +32,101 @@ RSpec.describe Asciidoctor::Standoc do
32
32
  expect(File.exist?("htmlstyle.css")).to be false
33
33
  end
34
34
 
35
- it "processes default metadata" do
35
+ it "processes publisher abbreviations" do
36
+ mock_org_abbrevs
36
37
  expect(xmlpp(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to xmlpp(<<~'OUTPUT')
38
+ = Document title
39
+ Author
40
+ :docfile: test.adoc
41
+ :nodoc:
42
+ :novalid:
43
+ :publisher: International Electrotechnical Commission,IETF,ISO
44
+ INPUT
45
+ <standard-document xmlns='https://www.metanorma.org/ns/standoc' type='semantic' version='1.5.3'>
46
+ <bibdata type='standard'>
47
+ <title language='en' format='text/plain'>Document title</title>
48
+ <contributor>
49
+ <role type='author'/>
50
+ <organization>
51
+ <name>International Electrotechnical Commission</name>
52
+ <abbreviation>IEC</abbreviation>
53
+ </organization>
54
+ </contributor>
55
+ <contributor>
56
+ <role type='author'/>
57
+ <organization>
58
+ <name>IETF</name>
59
+ </organization>
60
+ </contributor>
61
+ <contributor>
62
+ <role type='author'/>
63
+ <organization>
64
+ <name>International Standards Organization</name>
65
+ <abbreviation>ISO</abbreviation>
66
+ </organization>
67
+ </contributor>
68
+ <contributor>
69
+ <role type='publisher'/>
70
+ <organization>
71
+ <name>International Electrotechnical Commission</name>
72
+ <abbreviation>IEC</abbreviation>
73
+ </organization>
74
+ </contributor>
75
+ <contributor>
76
+ <role type='publisher'/>
77
+ <organization>
78
+ <name>IETF</name>
79
+ </organization>
80
+ </contributor>
81
+ <contributor>
82
+ <role type='publisher'/>
83
+ <organization>
84
+ <name>International Standards Organization</name>
85
+ <abbreviation>ISO</abbreviation>
86
+ </organization>
87
+ </contributor>
88
+ <language>en</language>
89
+ <script>Latn</script>
90
+ <status>
91
+ <stage>published</stage>
92
+ </status>
93
+ <copyright>
94
+ <from>2020</from>
95
+ <owner>
96
+ <organization>
97
+ <name>International Electrotechnical Commission</name>
98
+ <abbreviation>IEC</abbreviation>
99
+ </organization>
100
+ </owner>
101
+ </copyright>
102
+ <copyright>
103
+ <from>2020</from>
104
+ <owner>
105
+ <organization>
106
+ <name>IETF</name>
107
+ </organization>
108
+ </owner>
109
+ </copyright>
110
+ <copyright>
111
+ <from>2020</from>
112
+ <owner>
113
+ <organization>
114
+ <name>International Standards Organization</name>
115
+ <abbreviation>ISO</abbreviation>
116
+ </organization>
117
+ </owner>
118
+ </copyright>
119
+ <ext>
120
+ <doctype>article</doctype>
121
+ </ext>
122
+ </bibdata>
123
+ <sections> </sections>
124
+ </standard-document>
125
+ OUTPUT
126
+ end
127
+
128
+ it "processes default metadata" do
129
+ expect(xmlpp(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
37
130
  = Document title
38
131
  Author
39
132
  :docfile: test.adoc
@@ -109,7 +202,7 @@ RSpec.describe Asciidoctor::Standoc do
109
202
  :keywords: a, b, c
110
203
  INPUT
111
204
  <?xml version="1.0" encoding="UTF-8"?>
112
- <standard-document xmlns="https://www.metanorma.org/ns/standoc">
205
+ <standard-document xmlns="https://www.metanorma.org/ns/standoc" type="semantic" version="#{Metanorma::Standoc::VERSION}">
113
206
  <bibdata type="standard">
114
207
  <title language="en" format="text/plain">Main Title — Title</title>
115
208
  <docidentifier>1000-1</docidentifier>
@@ -339,7 +432,7 @@ RSpec.describe Asciidoctor::Standoc do
339
432
  == Clause 1
340
433
  INPUT
341
434
  <?xml version="1.0" encoding="UTF-8"?>
342
- <standard-document xmlns="https://www.metanorma.org/ns/standoc">
435
+ <standard-document xmlns="https://www.metanorma.org/ns/standoc" type="semantic" version="#{Metanorma::Standoc::VERSION}">
343
436
  <bibdata type="standard">
344
437
  <title language="en" format="text/plain">Document title</title>
345
438
  <title language="eo" format="text/plain">Dokumenttitolo</title>
@@ -526,6 +619,31 @@ QU1FOiB0ZXN0Cgo=
526
619
  ])
527
620
  end
528
621
 
622
+ it "test submitting-organizations with delimiter in end" do
623
+ FileUtils.rm_f "test.doc"
624
+ Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)
625
+ = Document title
626
+ Author
627
+ :docfile: test.adoc
628
+ :doctype: standard
629
+ :encoding: utf-8
630
+ :lang: en
631
+ :submitting-organizations: Organization One; Organization Two;
632
+ :publisher: "Hanna Barbera", "Cartoon Network", "Ribose, Inc.",
633
+ INPUT
634
+ expect(File.exist?("test.doc")).to be true
635
+ end
636
+
637
+ private
638
+
639
+ def mock_org_abbrevs
640
+ allow_any_instance_of(::Asciidoctor::Standoc::Front).to receive(:org_abbrev).and_return(
641
+ { "International Standards Organization" => "ISO",
642
+ "International Electrotechnical Commission" => "IEC" }
643
+ )
644
+ end
645
+
646
+
529
647
 
530
648
  end
531
649
 
@@ -273,7 +273,7 @@ RSpec.describe Asciidoctor::Standoc do
273
273
  For further information on the Foreword, see *ISO/IEC Directives, Part 2, 2016, Clause 12.*
274
274
  ****
275
275
  INPUT
276
- <standard-document xmlns="https://www.metanorma.org/ns/standoc">
276
+ <standard-document xmlns="https://www.metanorma.org/ns/standoc" type="semantic" version="#{Metanorma::Standoc::VERSION}">
277
277
  <bibdata type="standard">
278
278
  <title language="en" format="text/plain">Document title</title>
279
279
 
@@ -1167,7 +1167,7 @@ end
1167
1167
  # mock_iecbib_get_iec60050_102_01
1168
1168
  # mock_iecbib_get_iec60050_103_01
1169
1169
  # mock_iev
1170
- VCR.use_cassette "separates_iev_citations_by_top_level_clause" do
1170
+ VCR.use_cassette "separates_iev_citations_by_top_level_clause", :re_record_interval => 25200 do
1171
1171
  expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
1172
1172
  #{CACHED_ISOBIB_BLANK_HDR}
1173
1173
 
@@ -1236,6 +1236,7 @@ end
1236
1236
  <uri type="src">https://webstore.iec.ch/publication/160</uri>
1237
1237
  <uri type="obp">/preview/info_iec60050-102%7Bed1.0%7Db.pdf</uri>
1238
1238
  <docidentifier type="IEC">IEC 60050-102:2007</docidentifier>
1239
+ <docidentifier type='URN'>urn:iec:std:iec:60050-102:2007:::en</docidentifier>
1239
1240
  <date type="published">
1240
1241
  <on>2007</on>
1241
1242
  </date>
@@ -1274,6 +1275,7 @@ end
1274
1275
  <uri type="src">https://webstore.iec.ch/publication/161</uri>
1275
1276
  <uri type="obp">/preview/info_iec60050-103%7Bed1.0%7Db.pdf</uri>
1276
1277
  <docidentifier type="IEC">IEC 60050-103:2009</docidentifier>
1278
+ <docidentifier type='URN'>urn:iec:std:iec:60050-103:2009:::en</docidentifier>
1277
1279
  <date type="published">
1278
1280
  <on>2009</on>
1279
1281
  </date>
@@ -1619,7 +1621,7 @@ it "removes bibdata bibitem IDs" do
1619
1621
 
1620
1622
  INPUT
1621
1623
  <?xml version='1.0' encoding='UTF-8'?>
1622
- <standard-document xmlns='https://www.metanorma.org/ns/standoc'>
1624
+ <standard-document xmlns='https://www.metanorma.org/ns/standoc' type="semantic" version="#{Metanorma::Standoc::VERSION}">
1623
1625
  <bibdata type='standard'>
1624
1626
  <title language='en' format='text/plain'>Document title</title>
1625
1627
  <language>en</language>
@@ -1665,7 +1667,7 @@ it "imports boilerplate file" do
1665
1667
  == Clause 1
1666
1668
 
1667
1669
  INPUT
1668
- <standard-document xmlns='https://www.metanorma.org/ns/standoc'>
1670
+ <standard-document xmlns='https://www.metanorma.org/ns/standoc' type="semantic" version="#{Metanorma::Standoc::VERSION}">
1669
1671
  <bibdata type='standard'>
1670
1672
  <title language='en' format='text/plain'>Document title</title>
1671
1673
  <language>en</language>
@@ -2054,7 +2056,7 @@ expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, heade
2054
2056
  === Bibliography Subsection
2055
2057
 
2056
2058
  INPUT
2057
- <standard-document xmlns='https://www.metanorma.org/ns/standoc'>
2059
+ <standard-document xmlns='https://www.metanorma.org/ns/standoc' type="semantic" version="#{Metanorma::Standoc::VERSION}">
2058
2060
  <bibdata type='standard'>
2059
2061
  <title language='en' format='text/plain'>Document title</title>
2060
2062
  <language>en</language>
@@ -2330,7 +2332,7 @@ expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, heade
2330
2332
  === Bibliography Subsection
2331
2333
 
2332
2334
  INPUT
2333
- <standard-document xmlns='https://www.metanorma.org/ns/standoc'>
2335
+ <standard-document xmlns='https://www.metanorma.org/ns/standoc' type="semantic" version="#{Metanorma::Standoc::VERSION}">
2334
2336
  <bibdata type='standard'>
2335
2337
  <title language='en' format='text/plain'>Document title</title>
2336
2338
  <language>tlh</language>
@@ -2561,7 +2563,7 @@ expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, heade
2561
2563
  === Bibliography Subsection
2562
2564
 
2563
2565
  INPUT
2564
- <standard-document xmlns='https://www.metanorma.org/ns/standoc'>
2566
+ <standard-document xmlns='https://www.metanorma.org/ns/standoc' type="semantic" version="#{Metanorma::Standoc::VERSION}">
2565
2567
  <bibdata type='standard'>
2566
2568
  <title language='en' format='text/plain'>Document title</title>
2567
2569
  <language>fr</language>
@@ -2795,7 +2797,7 @@ expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, heade
2795
2797
  === Bibliography Subsection
2796
2798
 
2797
2799
  INPUT
2798
- <standard-document xmlns='https://www.metanorma.org/ns/standoc'>
2800
+ <standard-document xmlns='https://www.metanorma.org/ns/standoc' type="semantic" version="#{Metanorma::Standoc::VERSION}">
2799
2801
  <bibdata type='standard'>
2800
2802
  <title language='en' format='text/plain'>Document title</title>
2801
2803
  <language>zh</language>
@@ -3026,7 +3028,7 @@ expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, heade
3026
3028
  === Bibliography Subsection
3027
3029
 
3028
3030
  INPUT
3029
- <standard-document xmlns='https://www.metanorma.org/ns/standoc'>
3031
+ <standard-document xmlns='https://www.metanorma.org/ns/standoc' type="semantic" version="#{Metanorma::Standoc::VERSION}">
3030
3032
  <bibdata type='standard'>
3031
3033
  <title language='en' format='text/plain'>Document title</title>
3032
3034
  <language>en</language>
@@ -3176,7 +3178,7 @@ input = <<~INPUT
3176
3178
 
3177
3179
  INPUT
3178
3180
  expect(xmlpp(Asciidoctor.convert(input, backend: :standoc, header_footer: true).gsub(/<p id="_[^"]+">/, "").gsub('</p>', ""))).to be_equivalent_to (<<~"OUTPUT")
3179
- <standard-document xmlns='https://www.metanorma.org/ns/standoc'>
3181
+ <standard-document xmlns='https://www.metanorma.org/ns/standoc' type="semantic" version="#{Metanorma::Standoc::VERSION}">
3180
3182
  <bibdata type='standard'>
3181
3183
  <title language='en' format='text/plain'>Document title</title>
3182
3184
  <language>en</language>
@@ -10,7 +10,7 @@ RSpec.describe Asciidoctor::Standoc do
10
10
  text, including **__nest__**ed markup.
11
11
  INPUT
12
12
  <?xml version="1.0" encoding="UTF-8"?>
13
- <standard-document xmlns="https://www.metanorma.org/ns/standoc">
13
+ <standard-document xmlns="https://www.metanorma.org/ns/standoc" type="semantic" version="#{Metanorma::Standoc::VERSION}">
14
14
  <bibdata type="standard">
15
15
  <title language="en" format="text/plain">Document title</title>
16
16
  <language>en</language>
@@ -77,42 +77,147 @@ text, including <strong><em>nest</em></strong>ed markup.</p>
77
77
  OUTPUT
78
78
  end
79
79
 
80
+ it "process mtext spaces" do
81
+ expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
82
+ #{DUMBQUOTE_BLANK_HDR}
83
+
84
+ stem:[n < 1 " for all text "]
85
+ INPUT
86
+ #{BLANK_HDR}
87
+ <sections>
88
+ <p id='_'>
89
+ <stem type='MathML'>
90
+ <math xmlns='http://www.w3.org/1998/Math/MathML'>
91
+ <mi>n</mi>
92
+ <mo/>
93
+ <mn>1</mn>
94
+ <mtext> for all text </mtext>
95
+ </math>
96
+ </stem>
97
+ </p>
98
+ </sections>
99
+ </standard-document>
100
+ OUTPUT
101
+ end
102
+
80
103
  it "properly handles inline substitution" do
81
104
  expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
82
105
  #{DUMBQUOTE_BLANK_HDR}
83
106
 
84
107
  stem:[n < 1] +
85
108
  latexmath:[n < 1]
109
+ stem:["&#x200c;"^199 "Hg"^+]
86
110
  INPUT
87
111
  #{BLANK_HDR}
88
112
  <sections>
89
113
  <p id="_">
90
114
  <stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>n</mi><mo>&lt;</mo><mn>1</mn></math></stem><br/>
91
115
  <stem type="MathML"> <math xmlns="http://www.w3.org/1998/Math/MathML"> <mrow> <mi>n</mi> <mo>&lt;</mo> <mn>1</mn> </mrow> </math></stem>
116
+ <stem type='MathML'>
117
+ <math xmlns='http://www.w3.org/1998/Math/MathML'>
118
+ <msup>
119
+ <mrow>
120
+ <mtext>‌</mtext>
121
+ </mrow>
122
+ <mrow>
123
+ <mn>199</mn>
124
+ </mrow>
125
+ </msup>
126
+ <msup>
127
+ <mrow>
128
+ <mtext>Hg</mtext>
129
+ </mrow>
130
+ <mrow>
131
+ <mo>+</mo>
132
+ </mrow>
133
+ </msup>
134
+ </math>
135
+ </stem>
92
136
  </p>
93
137
  </sections>
94
138
  </standard-document>
95
139
  OUTPUT
96
140
  end
97
141
 
98
- it "normalises inline stem" do
142
+ it "normalises inline stem, straight quotes" do
99
143
  expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
100
144
  #{DUMBQUOTE_BLANK_HDR}
101
145
 
102
146
  stem:[n < 1]
103
147
  latexmath:[n < 1]
148
+ stem:["&#x200c;"^199 "Hg"^+]
149
+ INPUT
150
+ #{BLANK_HDR}
151
+ <sections>
152
+ <p id="_">
153
+ <stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>n</mi><mo>&lt;</mo><mn>1</mn></math></stem>
154
+ <stem type="MathML"> <math xmlns="http://www.w3.org/1998/Math/MathML"> <mrow> <mi>n</mi> <mo>&lt;</mo> <mn>1</mn> </mrow> </math></stem>
155
+ <stem type='MathML'>
156
+ <math xmlns='http://www.w3.org/1998/Math/MathML'>
157
+ <msup>
158
+ <mrow>
159
+ <mtext>‌</mtext>
160
+ </mrow>
161
+ <mrow>
162
+ <mn>199</mn>
163
+ </mrow>
164
+ </msup>
165
+ <msup>
166
+ <mrow>
167
+ <mtext>Hg</mtext>
168
+ </mrow>
169
+ <mrow>
170
+ <mo>+</mo>
171
+ </mrow>
172
+ </msup>
173
+ </math>
174
+ </stem>
175
+ </p>
176
+ </sections>
177
+ </standard-document>
178
+ OUTPUT
179
+ end
180
+
181
+ it "normalises inline stem, smart quotes" do
182
+ expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
183
+ #{ASCIIDOC_BLANK_HDR}
184
+
185
+ stem:[n < 1]
186
+ latexmath:[n < 1]
187
+ stem:["&#x200c;"^199 "Hg"^+]
104
188
  INPUT
105
189
  #{BLANK_HDR}
106
190
  <sections>
107
191
  <p id="_">
108
192
  <stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>n</mi><mo>&lt;</mo><mn>1</mn></math></stem>
109
193
  <stem type="MathML"> <math xmlns="http://www.w3.org/1998/Math/MathML"> <mrow> <mi>n</mi> <mo>&lt;</mo> <mn>1</mn> </mrow> </math></stem>
194
+ <stem type='MathML'>
195
+ <math xmlns='http://www.w3.org/1998/Math/MathML'>
196
+ <msup>
197
+ <mrow>
198
+ <mtext>‌</mtext>
199
+ </mrow>
200
+ <mrow>
201
+ <mn>199</mn>
202
+ </mrow>
203
+ </msup>
204
+ <msup>
205
+ <mrow>
206
+ <mtext>Hg</mtext>
207
+ </mrow>
208
+ <mrow>
209
+ <mo>+</mo>
210
+ </mrow>
211
+ </msup>
212
+ </math>
213
+ </stem>
110
214
  </p>
111
215
  </sections>
112
216
  </standard-document>
113
217
  OUTPUT
114
218
  end
115
219
 
220
+
116
221
  it "generates desired smart quotes for 'dd'" do
117
222
  expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
118
223
  #{ASCIIDOC_BLANK_HDR}
@@ -201,8 +306,14 @@ text, including <strong><em>nest</em></strong>ed markup.</p>
201
306
  Inline Reference with Text to <<reference,text>>
202
307
  Footnoted Reference with Text to <<reference,fn: text>>
203
308
  Anchored Crossreference to other document <<a.adoc#b>>
309
+ Capitalised Reference to <<reference,droploc%capital%>>
310
+ Lowercase Footnoted Reference to <<reference,capital%droploc%fn>>
204
311
  Capitalised Reference to <<reference,capital%>>
205
312
  Lowercase Footnoted Reference to <<reference,capital%fn>>
313
+ Capitalised Reference to <<reference,droploc%>>
314
+ Lowercase Footnoted Reference to <<reference,droploc%fn>>
315
+ Capitalised Reference to <<reference,droploc%capital%>>
316
+ Lowercase Footnoted Reference to <<reference,droploc%capital%fn>>
206
317
  INPUT
207
318
  #{BLANK_HDR}
208
319
  <sections>
@@ -213,8 +324,21 @@ text, including <strong><em>nest</em></strong>ed markup.</p>
213
324
  Inline Reference with Text to <xref target="reference">text</xref>
214
325
  Footnoted Reference with Text to <xref target="reference">text</xref>
215
326
  Anchored Crossreference to other document <xref target="a#b"/>
216
- Capitalised Reference to <xref target='reference' case='capital'></xref>
217
- Lowercase Footnoted Reference to <xref target='reference' case='capital'></xref></p>
327
+ Capitalised Reference to <xref target='reference' case='capital' droploc="true"></xref>
328
+ Lowercase Footnoted Reference to <xref target='reference' case='capital' droploc="true"></xref>
329
+ Capitalised Reference to
330
+ <xref target='reference' case='capital'/>
331
+ Lowercase Footnoted Reference to
332
+ <xref target='reference' case='capital'/>
333
+ Capitalised Reference to
334
+ <xref target='reference' droploc='true'/>
335
+ Lowercase Footnoted Reference to
336
+ <xref target='reference' droploc='true'/>
337
+ Capitalised Reference to
338
+ <xref target='reference' case='capital' droploc='true'/>
339
+ Lowercase Footnoted Reference to
340
+ <xref target='reference' case='capital' droploc='true'/>
341
+ </p>
218
342
  </clause>
219
343
  </sections>
220
344
  </standard-document>