isodoc 1.5.5 → 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.
@@ -590,6 +590,8 @@ OUTPUT
590
590
  <eref type="inline" bibitemid="ISO712" citeas="ISO 712">A</eref>
591
591
  <eref type="inline" bibitemid="ISO712"><locality type="anchor"><referenceFrom>1</referenceFrom></locality></eref>
592
592
  <eref type="inline" bibitemid="ISO712"><locality type="anchor"><referenceFrom>1</referenceFrom></locality><locality type="clause"><referenceFrom>1</referenceFrom></locality></eref>
593
+ <eref type="inline" droploc="true" bibitemid="ISO712"><locality type="anchor"><referenceFrom>1</referenceFrom></locality><locality type="clause"><referenceFrom>1</referenceFrom></locality></eref>
594
+ <eref type="inline" case="lowercase" bibitemid="ISO712"><locality type="anchor"><referenceFrom>1</referenceFrom></locality><locality type="clause"><referenceFrom>1</referenceFrom></locality></eref>
593
595
  </p>
594
596
  </foreword></preface>
595
597
  <bibliography><references id="_normative_references" obligation="informative" normative="true"><title>Normative References</title>
@@ -626,6 +628,8 @@ OUTPUT
626
628
  <eref type="inline" bibitemid="ISO712" citeas="ISO 712">A</eref>
627
629
  <eref type="inline" bibitemid="ISO712"><locality type="anchor"><referenceFrom>1</referenceFrom></locality>ISO 712</eref>
628
630
  <eref type="inline" bibitemid="ISO712"><locality type="anchor"><referenceFrom>1</referenceFrom></locality><locality type="clause"><referenceFrom>1</referenceFrom></locality>ISO 712, Clause 1</eref>
631
+ <eref type="inline" droploc="true" bibitemid="ISO712"><locality type="anchor"><referenceFrom>1</referenceFrom></locality><locality type="clause"><referenceFrom>1</referenceFrom></locality>ISO 712, 1</eref>
632
+ <eref type="inline" case="lowercase" bibitemid="ISO712"><locality type="anchor"><referenceFrom>1</referenceFrom></locality><locality type="clause"><referenceFrom>1</referenceFrom></locality>ISO 712, clause 1</eref>
629
633
  </p>
630
634
  </foreword></preface>
631
635
  <bibliography><references id="_normative_references" obligation="informative" normative="true"><title depth='1'>1.<tab/>Normative References</title>
@@ -665,6 +669,8 @@ html = <<~OUTPUT
665
669
  <a href="#ISO712">A</a>
666
670
  <a href='#ISO712'>ISO 712</a>
667
671
  <a href='#ISO712'>ISO 712, Clause 1</a>
672
+ <a href='#ISO712'>ISO 712, 1</a>
673
+ <a href='#ISO712'>ISO 712, clause 1</a>
668
674
  </p>
669
675
  </div>
670
676
  <p class="zzSTDTitle1"/>
@@ -1017,4 +1023,32 @@ INPUT
1017
1023
  OUTPUT
1018
1024
  end
1019
1025
 
1026
+ it "processes add, del" do
1027
+ expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
1028
+ <itu-standard xmlns="https://www.calconnect.org/standards/itu">
1029
+ <preface><foreword id="A">
1030
+ <add>ABC <xref target="A"></add> <del><strong>B</strong></del>
1031
+ </foreword></preface>
1032
+ </itu-standard>
1033
+ INPUT
1034
+ #{HTML_HDR}
1035
+ <br/>
1036
+ <div id='A'>
1037
+ <h1 class='ForewordTitle'>Foreword</h1>
1038
+ <span class='addition'>
1039
+ ABC
1040
+ <a href='#A'/>
1041
+ <span class='deletion'>
1042
+ <b>B</b>
1043
+ </span>
1044
+ </span>
1045
+ </div>
1046
+ <p class='zzSTDTitle1'/>
1047
+ </div>
1048
+ </body>
1049
+ </html>
1050
+ OUTPUT
1051
+ end
1052
+
1053
+
1020
1054
  end
@@ -27,6 +27,27 @@ RSpec.describe IsoDoc do
27
27
  expect(html).to match(/delimiters: \[\['\(#\(', '\)#\)'\]\]/)
28
28
  end
29
29
 
30
+ it "generates file in a remote directory" do
31
+ FileUtils.rm_f "spec/assets/test.doc"
32
+ FileUtils.rm_f "spec/assets/test.html"
33
+ IsoDoc::HtmlConvert.new({wordstylesheet: "word.css", htmlstylesheet: "html.scss", filename: "test"}).convert("spec/assets/test", <<~"INPUT", false)
34
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
35
+ <bibdata>
36
+ <title language="en">test</title>
37
+ </bibdata>
38
+ <preface><foreword>
39
+ <note>
40
+ <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p>
41
+ </note>
42
+ </foreword></preface>
43
+ </iso-standard>
44
+ INPUT
45
+ expect(File.exist?("spec/assets/test.html")).to be true
46
+ html = File.read("spec/assets/test.html")
47
+ expect(html).to match(%r{<title>test</title>})
48
+ expect(html).to match(/another empty stylesheet/)
49
+ end
50
+
30
51
  it "ignores Liquid markup in the document body" do
31
52
  FileUtils.rm_f "test.doc"
32
53
  FileUtils.rm_f "test.html"
@@ -108,17 +129,19 @@ expect(File.exist?("test.doc")).to be true
108
129
  it "generates HTML output docs with null configuration from file" do
109
130
  FileUtils.rm_f "spec/assets/iso.doc"
110
131
  FileUtils.rm_f "spec/assets/iso.html"
111
- IsoDoc::HtmlConvert.new({wordstylesheet: "spec/assets/word.css", htmlstylesheet: "spec/assets/html.scss"}).convert("spec/assets/iso.xml", nil, false)
132
+ IsoDoc::HtmlConvert.new({wordstylesheet: "word.css", htmlstylesheet: "html.scss"}).convert("spec/assets/iso.xml", nil, false)
112
133
  expect(File.exist?("spec/assets/iso.html")).to be true
113
134
  html = File.read("spec/assets/iso.html")
114
135
  expect(html).to match(/another empty stylesheet/)
115
136
  expect(html).to match(%r{https://use.fontawesome.com})
116
137
  expect(html).to match(%r{libs/jquery})
138
+ expect(html).to include "$('#toggle')"
139
+ expect(html).not_to match(/CDATA/)
117
140
  end
118
141
 
119
142
  it "generates Headless HTML output docs with null configuration from file" do
120
143
  FileUtils.rm_f "spec/assets/iso.html"
121
- IsoDoc::HeadlessHtmlConvert.new({wordstylesheet: "spec/assets/word.css", htmlstylesheet: "spec/assets/html.scss"}).convert("spec/assets/iso.xml", nil, false)
144
+ IsoDoc::HeadlessHtmlConvert.new({wordstylesheet: "word.css", htmlstylesheet: "html.scss"}).convert("spec/assets/iso.xml", nil, false)
122
145
  expect(File.exist?("spec/assets/iso.headless.html")).to be true
123
146
  html = File.read("spec/assets/iso.headless.html")
124
147
  expect(html).not_to match(/another empty stylesheet/)
@@ -132,7 +155,7 @@ expect(File.exist?("test.doc")).to be true
132
155
 
133
156
  it "generates Word output docs with null configuration from file" do
134
157
  FileUtils.rm_f "spec/assets/iso.doc"
135
- IsoDoc::WordConvert.new({wordstylesheet: "spec/assets/word.css", htmlstylesheet: "spec/assets/html.scss"}).convert("spec/assets/iso.xml", nil, false)
158
+ IsoDoc::WordConvert.new({wordstylesheet: "word.css", htmlstylesheet: "html.scss"}).convert("spec/assets/iso.xml", nil, false)
136
159
  expect(File.exist?("spec/assets/iso.doc")).to be true
137
160
  word = File.read("spec/assets/iso.doc")
138
161
  expect(word).to match(/one empty stylesheet/)
@@ -217,8 +240,7 @@ expect(File.exist?("test.doc")).to be true
217
240
  expect(word).to match(/p\.note \{[^}]*?font-size: 28pt/m)
218
241
  expect(word).to match(/aside \{[^}]*?font-size: 27pt/m)
219
242
  expect(word).to match(/a third empty stylesheet/)
220
- #expect(word).to match(/<title>test<\/title>/)
221
- expect(word).to match(/test_files\/header.html/)
243
+ expect(word).to match(/Content-Disposition: inline; filename="filelist.xml"/)
222
244
  expect(word).to match(/an empty word cover page/)
223
245
  expect(word).to match(/an empty word intro page/)
224
246
  expect(word).to match(%r{Anta&#x16D;parolo</h1>})
@@ -248,7 +270,7 @@ expect(File.exist?("test.doc")).to be true
248
270
  expect(word).to match(/aside \{[^}]*?font-size: 9pt/m)
249
271
  expect(word).to match(/a third empty stylesheet/)
250
272
  #expect(word).to match(/<title>test<\/title>/)
251
- expect(word).to match(/test_files\/header.html/)
273
+ expect(word).to match(/Content-Disposition: inline; filename="filelist.xml"/)
252
274
  expect(word).to match(/an empty word cover page/)
253
275
  expect(word).to match(/an empty word intro page/)
254
276
  expect(word).to match(%r{Anta&#x16D;parolo</h1>})
@@ -339,10 +361,12 @@ expect(File.exist?("test.doc")).to be true
339
361
  </bibdata>
340
362
  </iso-standard>
341
363
  INPUT
342
- word = File.read("test.doc").sub(%r{^.*Content-Location: file:///C:/Doc/test_files/header.html}m, "Content-Location: file:///C:/Doc/test_files/header.html").
343
- sub(/------=_NextPart.*$/m, "")
364
+ word = File.read("test.doc")
365
+ .sub(%r{^.*Content-ID: <header.html>}m, "Content-ID: <header.html>")
366
+ .sub(/------=_NextPart.*$/m, "")
344
367
  expect(word).to be_equivalent_to <<~"OUTPUT"
345
- Content-Location: file:///C:/Doc/test_files/header.html
368
+ Content-ID: <header.html>
369
+ Content-Disposition: inline; filename="header.html"
346
370
  Content-Transfer-Encoding: base64
347
371
  Content-Type: text/html charset="utf-8"
348
372
  Ci8qIGFuIGVtcHR5IGhlYWRlciAqLwoKU1RBUlQgRE9DIElEOiAKICAgICAgICAgICAxMDAwCiAg
@@ -356,7 +380,7 @@ ICAgICAgIDogRU5EIERPQyBJRAoKRklMRU5BTUU6IHRlc3QKCg==
356
380
  <iso-standard xmlns="http://riboseinc.com/isoxml">
357
381
  <sections>
358
382
  <clause id="A" inline-header="false" obligation="normative"><title>Clause 4</title><clause id="N" inline-header="false" obligation="normative">
359
- <title>Introduction<bookmark id="Q"/> to this<fn reference="1">
383
+ <title>Introduction<bookmark id="Q"/> to this <image src="spec/assets/rice_image1.png" id="_" mimetype="image/png"/> <fn reference="1">
360
384
  <p id="_ff27c067-2785-4551-96cf-0a73530ff1e6">Formerly denoted as 15 % (m/m).</p>
361
385
  </fn></title>
362
386
  </clause>
@@ -826,7 +850,7 @@ TOCLEVEL
826
850
  it "moves images in HTML, using relative file location" do
827
851
  FileUtils.rm_f "spec/test.html"
828
852
  FileUtils.rm_rf "spec/test_htmlimages"
829
- IsoDoc::HtmlConvert.new({wordstylesheet: "spec/assets/word.css", htmlstylesheet: "spec/assets/html.scss"}).convert("spec/test", <<~"INPUT", false)
853
+ IsoDoc::HtmlConvert.new({wordstylesheet: "assets/word.css", htmlstylesheet: "assets/html.scss"}).convert("spec/test", <<~"INPUT", false)
830
854
  <iso-standard xmlns="http://riboseinc.com/isoxml">
831
855
  <preface><foreword>
832
856
  <figure id="_">
@@ -895,7 +919,7 @@ TOCLEVEL
895
919
  it "encodes images in HTML as data URIs, using relative file location" do
896
920
  FileUtils.rm_f "spec/test.html"
897
921
  FileUtils.rm_rf "spec/test_htmlimages"
898
- IsoDoc::HtmlConvert.new({htmlstylesheet: "spec/assets/html.scss", datauriimage: true}).convert("spec/test", <<~"INPUT", false)
922
+ IsoDoc::HtmlConvert.new({htmlstylesheet: "assets/html.scss", datauriimage: true}).convert("spec/test", <<~"INPUT", false)
899
923
  <iso-standard xmlns="http://riboseinc.com/isoxml">
900
924
  <preface><foreword>
901
925
  <figure id="_">
@@ -1,136 +1,137 @@
1
1
  require "spec_helper"
2
2
 
3
3
  RSpec.describe IsoDoc do
4
- it "generates file based on string input" do
5
- FileUtils.rm_f "test.presentation.xml"
6
- IsoDoc::PresentationXMLConvert.new({filename: "test"}).convert("test", <<~"INPUT", false)
7
- <iso-standard xmlns="http://riboseinc.com/isoxml">
8
- <bibdata>
9
- <title language="en">test</title>
10
- </bibdata>
11
- <preface><foreword>
12
- <note>
13
- <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p>
14
- </note>
15
- </foreword></preface>
16
- </iso-standard>
4
+ it "generates file based on string input" do
5
+ FileUtils.rm_f "test.presentation.xml"
6
+ IsoDoc::PresentationXMLConvert.new({ filename: "test" })
7
+ .convert("test", <<~"INPUT", false)
8
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
9
+ <bibdata>
10
+ <title language="en">test</title>
11
+ </bibdata>
12
+ <preface><foreword>
13
+ <note>
14
+ <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p>
15
+ </note>
16
+ </foreword></preface>
17
+ </iso-standard>
17
18
  INPUT
18
19
  expect(File.exist?("test.presentation.xml")).to be true
19
20
  end
20
21
 
21
- it "localises numbers in MathML" do
22
- expect(xmlpp(IsoDoc::PresentationXMLConvert.new({}).convert("test", <<~INPUT, true)).sub(%r{<localized-strings>.*</localized-strings>}m, "")).to be_equivalent_to xmlpp(<<~OUTPUT)
23
- <iso-standard xmlns="http://riboseinc.com/isoxml">
24
- <bibdata>
25
- <title language="en">test</title>
26
- </bibdata>
27
- <preface>
28
- <p>
29
- <stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><mn>64212149677264515</mn></math></stem>
30
- <stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><mn>642121496772645.15</mn></math></stem>
31
- <stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><mn>30000</mn></math></stem>
32
- <stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>P</mi><mfenced open="(" close=")"><mrow><mi>X</mi><mo>≥</mo><msub><mrow><mi>X</mi></mrow><mrow><mo>max</mo></mrow></msub></mrow></mfenced><mo>=</mo><munderover><mrow><mo>∑</mo></mrow><mrow><mrow><mi>j</mi><mo>=</mo><msub><mrow><mi>X</mi></mrow><mrow><mo>max</mo></mrow></msub></mrow></mrow><mrow><mn>1000</mn></mrow></munderover><mfenced open="(" close=")"><mtable><mtr><mtd><mn>1000</mn></mtd></mtr><mtr><mtd><mi>j</mi></mtd></mtr></mtable></mfenced><msup><mrow><mi>p</mi></mrow><mrow><mi>j</mi></mrow></msup><msup><mrow><mfenced open="(" close=")"><mrow><mn>1</mn><mo>−</mo><mi>p</mi></mrow></mfenced></mrow><mrow><mrow><mn>1.003</mn><mo>−</mo><mi>j</mi></mrow></mrow></msup></math></stem></p>
33
- </preface>
34
- </iso-standard>
35
- INPUT
36
- <iso-standard xmlns='http://riboseinc.com/isoxml' type='presentation'>
37
- <bibdata>
38
- <title language='en'>test</title>
39
- </bibdata>
40
-
41
- <preface>
42
- <p>
43
- 64,212,149,677,264,515
44
- 642,121,496,772,645.15 30,000
45
- <stem type='MathML'>
46
- <math xmlns='http://www.w3.org/1998/Math/MathML'>
47
- <mi>P</mi>
48
- <mfenced open='(' close=')'>
49
- <mrow>
50
- <mi>X</mi>
51
- <mo>&#x2265;</mo>
52
- <msub>
53
- <mrow>
54
- <mi>X</mi>
55
- </mrow>
56
- <mrow>
57
- <mo>max</mo>
58
- </mrow>
59
- </msub>
60
- </mrow>
61
- </mfenced>
62
- <mo>=</mo>
63
- <munderover>
64
- <mrow>
65
- <mo>&#x2211;</mo>
66
- </mrow>
67
- <mrow>
68
- <mrow>
69
- <mi>j</mi>
70
- <mo>=</mo>
71
- <msub>
72
- <mrow>
73
- <mi>X</mi>
74
- </mrow>
75
- <mrow>
76
- <mo>max</mo>
77
- </mrow>
78
- </msub>
79
- </mrow>
80
- </mrow>
81
- <mrow>
82
- <mn>1,000</mn>
83
- </mrow>
84
- </munderover>
85
- <mfenced open='(' close=')'>
86
- <mtable>
87
- <mtr>
88
- <mtd>
89
- <mn>1,000</mn>
90
- </mtd>
91
- </mtr>
92
- <mtr>
93
- <mtd>
94
- <mi>j</mi>
95
- </mtd>
96
- </mtr>
97
- </mtable>
98
- </mfenced>
99
- <msup>
100
- <mrow>
101
- <mi>p</mi>
102
- </mrow>
103
- <mrow>
104
- <mi>j</mi>
105
- </mrow>
106
- </msup>
107
- <msup>
108
- <mrow>
109
- <mfenced open='(' close=')'>
110
- <mrow>
111
- <mn>1</mn>
112
- <mo>&#x2212;</mo>
113
- <mi>p</mi>
114
- </mrow>
115
- </mfenced>
116
- </mrow>
117
- <mrow>
118
- <mrow>
119
- <mn>1.003</mn>
120
- <mo>&#x2212;</mo>
121
- <mi>j</mi>
122
- </mrow>
123
- </mrow>
124
- </msup>
125
- </math>
126
- </stem>
127
- </p>
128
- </preface>
129
- </iso-standard>
130
- OUTPUT
131
- end
22
+ it "localises numbers in MathML" do
23
+ expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
24
+ .convert("test", <<~INPUT, true)).sub(%r{<localized-strings>.*</localized-strings>}m, "")).to be_equivalent_to xmlpp(<<~OUTPUT)
25
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
26
+ <bibdata>
27
+ <title language="en">test</title>
28
+ </bibdata>
29
+ <preface>
30
+ <p>
31
+ <stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><mn>64212149677264515</mn></math></stem>
32
+ <stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><mn>642121496772645.15</mn></math></stem>
33
+ <stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><mn>30000</mn></math></stem>
34
+ <stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>P</mi><mfenced open="(" close=")"><mrow><mi>X</mi><mo>≥</mo><msub><mrow><mi>X</mi></mrow><mrow><mo>max</mo></mrow></msub></mrow></mfenced><mo>=</mo><munderover><mrow><mo>∑</mo></mrow><mrow><mrow><mi>j</mi><mo>=</mo><msub><mrow><mi>X</mi></mrow><mrow><mo>max</mo></mrow></msub></mrow></mrow><mrow><mn>1000</mn></mrow></munderover><mfenced open="(" close=")"><mtable><mtr><mtd><mn>1000</mn></mtd></mtr><mtr><mtd><mi>j</mi></mtd></mtr></mtable></mfenced><msup><mrow><mi>p</mi></mrow><mrow><mi>j</mi></mrow></msup><msup><mrow><mfenced open="(" close=")"><mrow><mn>1</mn><mo>−</mo><mi>p</mi></mrow></mfenced></mrow><mrow><mrow><mn>1.003</mn><mo>−</mo><mi>j</mi></mrow></mrow></msup></math></stem></p>
35
+ </preface>
36
+ </iso-standard>
37
+ INPUT
38
+ <iso-standard xmlns='http://riboseinc.com/isoxml' type='presentation'>
39
+ <bibdata>
40
+ <title language='en'>test</title>
41
+ </bibdata>
42
+ <preface>
43
+ <p>
44
+ 64,212,149,677,264,515
45
+ 642,121,496,772,645.15 30,000
46
+ <stem type='MathML'>
47
+ <math xmlns='http://www.w3.org/1998/Math/MathML'>
48
+ <mi>P</mi>
49
+ <mfenced open='(' close=')'>
50
+ <mrow>
51
+ <mi>X</mi>
52
+ <mo>&#x2265;</mo>
53
+ <msub>
54
+ <mrow>
55
+ <mi>X</mi>
56
+ </mrow>
57
+ <mrow>
58
+ <mo>max</mo>
59
+ </mrow>
60
+ </msub>
61
+ </mrow>
62
+ </mfenced>
63
+ <mo>=</mo>
64
+ <munderover>
65
+ <mrow>
66
+ <mo>&#x2211;</mo>
67
+ </mrow>
68
+ <mrow>
69
+ <mrow>
70
+ <mi>j</mi>
71
+ <mo>=</mo>
72
+ <msub>
73
+ <mrow>
74
+ <mi>X</mi>
75
+ </mrow>
76
+ <mrow>
77
+ <mo>max</mo>
78
+ </mrow>
79
+ </msub>
80
+ </mrow>
81
+ </mrow>
82
+ <mrow>
83
+ <mn>1,000</mn>
84
+ </mrow>
85
+ </munderover>
86
+ <mfenced open='(' close=')'>
87
+ <mtable>
88
+ <mtr>
89
+ <mtd>
90
+ <mn>1,000</mn>
91
+ </mtd>
92
+ </mtr>
93
+ <mtr>
94
+ <mtd>
95
+ <mi>j</mi>
96
+ </mtd>
97
+ </mtr>
98
+ </mtable>
99
+ </mfenced>
100
+ <msup>
101
+ <mrow>
102
+ <mi>p</mi>
103
+ </mrow>
104
+ <mrow>
105
+ <mi>j</mi>
106
+ </mrow>
107
+ </msup>
108
+ <msup>
109
+ <mrow>
110
+ <mfenced open='(' close=')'>
111
+ <mrow>
112
+ <mn>1</mn>
113
+ <mo>&#x2212;</mo>
114
+ <mi>p</mi>
115
+ </mrow>
116
+ </mfenced>
117
+ </mrow>
118
+ <mrow>
119
+ <mrow>
120
+ <mn>1.003</mn>
121
+ <mo>&#x2212;</mo>
122
+ <mi>j</mi>
123
+ </mrow>
124
+ </mrow>
125
+ </msup>
126
+ </math>
127
+ </stem>
128
+ </p>
129
+ </preface>
130
+ </iso-standard>
131
+ OUTPUT
132
+ end
132
133
 
133
- context 'when twitter_cldr_localiser_symbols has additional options' do
134
+ context "when twitter_cldr_localiser_symbols has additional options" do
134
135
  let(:input) do
135
136
  <<~INPUT
136
137
  <iso-standard xmlns="http://riboseinc.com/isoxml">
@@ -362,7 +363,7 @@ end
362
363
  {
363
364
  fraction_group_digits: 2,
364
365
  fraction_group: "'",
365
- precision: 5
366
+ precision: 5,
366
367
  }
367
368
  end
368
369
 
@@ -372,234 +373,236 @@ end
372
373
  end
373
374
 
374
375
  it "Supports twitter_cldr_localiser_symbols fraction options" do
375
- expect(xmlpp(IsoDoc::PresentationXMLConvert.new({}).convert("test", input, true))
376
- .sub(%r{<localized-strings>.*</localized-strings>}m, ""))
376
+ expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
377
+ .convert("test", input, true))
378
+ .sub(%r{<localized-strings>.*</localized-strings>}m, ""))
377
379
  .to(be_equivalent_to(xmlpp(output)))
378
380
  end
379
381
  end
380
382
 
381
- it "localises numbers in MathML in French" do
382
- expect(xmlpp(IsoDoc::PresentationXMLConvert.new({}).convert("test", <<~INPUT, true)).sub(%r{<localized-strings>.*</localized-strings>}m, "")).to be_equivalent_to xmlpp(<<~OUTPUT)
383
- <iso-standard xmlns="http://riboseinc.com/isoxml">
384
- <bibdata>
385
- <title language="en">test</title>
386
- <language>fr</language>
387
- </bibdata>
388
- <preface>
389
- <p><math xmlns="http://www.w3.org/1998/Math/MathML"><mn>30000</mn></math>
390
- <stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>P</mi><mfenced open="(" close=")"><mrow><mi>X</mi><mo>≥</mo><msub><mrow><mi>X</mi></mrow><mrow><mo>max</mo></mrow></msub></mrow></mfenced><mo>=</mo><munderover><mrow><mo>∑</mo></mrow><mrow><mrow><mi>j</mi><mo>=</mo><msub><mrow><mi>X</mi></mrow><mrow><mo>max</mo></mrow></msub></mrow></mrow><mrow><mn>1000</mn></mrow></munderover><mfenced open="(" close=")"><mtable><mtr><mtd><mn>1000</mn></mtd></mtr><mtr><mtd><mi>j</mi></mtd></mtr></mtable></mfenced><msup><mrow><mi>p</mi></mrow><mrow><mi>j</mi></mrow></msup><msup><mrow><mfenced open="(" close=")"><mrow><mn>1</mn><mo>−</mo><mi>p</mi></mrow></mfenced></mrow><mrow><mrow><mn>1.003</mn><mo>−</mo><mi>j</mi></mrow></mrow></msup></math></stem></p>
391
- </preface>
392
- </iso-standard>
393
- INPUT
394
- <iso-standard xmlns='http://riboseinc.com/isoxml' type='presentation'>
395
- <bibdata>
396
- <title language='en'>test</title>
397
- <language current='true'>fr</language>
398
- </bibdata>
399
-
400
- <preface>
401
- <p>
402
- 30&#x202F;000
403
- <stem type='MathML'>
404
- <math xmlns='http://www.w3.org/1998/Math/MathML'>
405
- <mi>P</mi>
406
- <mfenced open='(' close=')'>
407
- <mrow>
408
- <mi>X</mi>
409
- <mo>&#x2265;</mo>
410
- <msub>
411
- <mrow>
412
- <mi>X</mi>
413
- </mrow>
414
- <mrow>
415
- <mo>max</mo>
416
- </mrow>
417
- </msub>
418
- </mrow>
419
- </mfenced>
420
- <mo>=</mo>
421
- <munderover>
422
- <mrow>
423
- <mo>&#x2211;</mo>
424
- </mrow>
425
- <mrow>
426
- <mrow>
427
- <mi>j</mi>
428
- <mo>=</mo>
429
- <msub>
430
- <mrow>
431
- <mi>X</mi>
432
- </mrow>
433
- <mrow>
434
- <mo>max</mo>
435
- </mrow>
436
- </msub>
437
- </mrow>
438
- </mrow>
439
- <mrow>
440
- <mn>1&#x202F;000</mn>
441
- </mrow>
442
- </munderover>
443
- <mfenced open='(' close=')'>
444
- <mtable>
445
- <mtr>
446
- <mtd>
447
- <mn>1&#x202F;000</mn>
448
- </mtd>
449
- </mtr>
450
- <mtr>
451
- <mtd>
452
- <mi>j</mi>
453
- </mtd>
454
- </mtr>
455
- </mtable>
456
- </mfenced>
457
- <msup>
458
- <mrow>
459
- <mi>p</mi>
460
- </mrow>
461
- <mrow>
462
- <mi>j</mi>
463
- </mrow>
464
- </msup>
465
- <msup>
466
- <mrow>
467
- <mfenced open='(' close=')'>
468
- <mrow>
469
- <mn>1</mn>
470
- <mo>&#x2212;</mo>
471
- <mi>p</mi>
472
- </mrow>
473
- </mfenced>
474
- </mrow>
475
- <mrow>
476
- <mrow>
477
- <mn>1,003</mn>
478
- <mo>&#x2212;</mo>
479
- <mi>j</mi>
480
- </mrow>
481
- </mrow>
482
- </msup>
483
- </math>
484
- </stem>
485
- </p>
486
- </preface>
487
- </iso-standard>
488
- OUTPUT
489
- end
383
+ it "localises numbers in MathML in French" do
384
+ expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
385
+ .convert("test", <<~INPUT, true)).sub(%r{<localized-strings>.*</localized-strings>}m, "")).to be_equivalent_to xmlpp(<<~OUTPUT)
386
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
387
+ <bibdata>
388
+ <title language="en">test</title>
389
+ <language>fr</language>
390
+ </bibdata>
391
+ <preface>
392
+ <p><math xmlns="http://www.w3.org/1998/Math/MathML"><mn>30000</mn></math>
393
+ <stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>P</mi><mfenced open="(" close=")"><mrow><mi>X</mi><mo>≥</mo><msub><mrow><mi>X</mi></mrow><mrow><mo>max</mo></mrow></msub></mrow></mfenced><mo>=</mo><munderover><mrow><mo>∑</mo></mrow><mrow><mrow><mi>j</mi><mo>=</mo><msub><mrow><mi>X</mi></mrow><mrow><mo>max</mo></mrow></msub></mrow></mrow><mrow><mn>1000</mn></mrow></munderover><mfenced open="(" close=")"><mtable><mtr><mtd><mn>1000</mn></mtd></mtr><mtr><mtd><mi>j</mi></mtd></mtr></mtable></mfenced><msup><mrow><mi>p</mi></mrow><mrow><mi>j</mi></mrow></msup><msup><mrow><mfenced open="(" close=")"><mrow><mn>1</mn><mo>−</mo><mi>p</mi></mrow></mfenced></mrow><mrow><mrow><mn>1.003</mn><mo>−</mo><mi>j</mi></mrow></mrow></msup></math></stem></p>
394
+ </preface>
395
+ </iso-standard>
396
+ INPUT
397
+ <iso-standard xmlns='http://riboseinc.com/isoxml' type='presentation'>
398
+ <bibdata>
399
+ <title language='en'>test</title>
400
+ <language current='true'>fr</language>
401
+ </bibdata>
402
+ <preface>
403
+ <p>
404
+ 30&#x202F;000
405
+ <stem type='MathML'>
406
+ <math xmlns='http://www.w3.org/1998/Math/MathML'>
407
+ <mi>P</mi>
408
+ <mfenced open='(' close=')'>
409
+ <mrow>
410
+ <mi>X</mi>
411
+ <mo>&#x2265;</mo>
412
+ <msub>
413
+ <mrow>
414
+ <mi>X</mi>
415
+ </mrow>
416
+ <mrow>
417
+ <mo>max</mo>
418
+ </mrow>
419
+ </msub>
420
+ </mrow>
421
+ </mfenced>
422
+ <mo>=</mo>
423
+ <munderover>
424
+ <mrow>
425
+ <mo>&#x2211;</mo>
426
+ </mrow>
427
+ <mrow>
428
+ <mrow>
429
+ <mi>j</mi>
430
+ <mo>=</mo>
431
+ <msub>
432
+ <mrow>
433
+ <mi>X</mi>
434
+ </mrow>
435
+ <mrow>
436
+ <mo>max</mo>
437
+ </mrow>
438
+ </msub>
439
+ </mrow>
440
+ </mrow>
441
+ <mrow>
442
+ <mn>1&#x202F;000</mn>
443
+ </mrow>
444
+ </munderover>
445
+ <mfenced open='(' close=')'>
446
+ <mtable>
447
+ <mtr>
448
+ <mtd>
449
+ <mn>1&#x202F;000</mn>
450
+ </mtd>
451
+ </mtr>
452
+ <mtr>
453
+ <mtd>
454
+ <mi>j</mi>
455
+ </mtd>
456
+ </mtr>
457
+ </mtable>
458
+ </mfenced>
459
+ <msup>
460
+ <mrow>
461
+ <mi>p</mi>
462
+ </mrow>
463
+ <mrow>
464
+ <mi>j</mi>
465
+ </mrow>
466
+ </msup>
467
+ <msup>
468
+ <mrow>
469
+ <mfenced open='(' close=')'>
470
+ <mrow>
471
+ <mn>1</mn>
472
+ <mo>&#x2212;</mo>
473
+ <mi>p</mi>
474
+ </mrow>
475
+ </mfenced>
476
+ </mrow>
477
+ <mrow>
478
+ <mrow>
479
+ <mn>1,003</mn>
480
+ <mo>&#x2212;</mo>
481
+ <mi>j</mi>
482
+ </mrow>
483
+ </mrow>
484
+ </msup>
485
+ </math>
486
+ </stem>
487
+ </p>
488
+ </preface>
489
+ </iso-standard>
490
+ OUTPUT
491
+ end
490
492
 
491
- it "customises localisation of numbers" do
492
- mock_symbols
493
- expect(xmlpp(IsoDoc::PresentationXMLConvert.new({}).convert("test", <<~INPUT, true)).sub(%r{<localized-strings>.*</localized-strings>}m, "")).to be_equivalent_to xmlpp(<<~OUTPUT)
494
- <iso-standard xmlns="http://riboseinc.com/isoxml">
495
- <bibdata>
496
- <title language="en">test</title>
497
- <language>fr</language>
498
- </bibdata>
499
- <preface>
500
- <p><stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><mn>30000</mn></math></stem>
501
- <stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>P</mi><mfenced open="(" close=")"><mrow><mi>X</mi><mo>≥</mo><msub><mrow><mi>X</mi></mrow><mrow><mo>max</mo></mrow></msub></mrow></mfenced><mo>=</mo><munderover><mrow><mo>∑</mo></mrow><mrow><mrow><mi>j</mi><mo>=</mo><msub><mrow><mi>X</mi></mrow><mrow><mo>max</mo></mrow></msub></mrow></mrow><mrow><mn>1000</mn></mrow></munderover><mfenced open="(" close=")"><mtable><mtr><mtd><mn>1000</mn></mtd></mtr><mtr><mtd><mi>j</mi></mtd></mtr></mtable></mfenced><msup><mrow><mi>p</mi></mrow><mrow><mi>j</mi></mrow></msup><msup><mrow><mfenced open="(" close=")"><mrow><mn>0.0000032</mn><mo>−</mo><mi>p</mi></mrow></mfenced></mrow><mrow><mrow><mn>1.003</mn><mo>−</mo><mi>j</mi></mrow></mrow></msup></math></stem></p>
502
- </preface>
503
- </iso-standard>
504
- INPUT
505
- <iso-standard xmlns='http://riboseinc.com/isoxml' type='presentation'>
506
- <bibdata>
507
- <title language='en'>test</title>
508
- <language current='true'>fr</language>
509
- </bibdata>
493
+ it "customises localisation of numbers" do
494
+ mock_symbols
495
+ expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
496
+ .convert("test", <<~INPUT, true)).sub(%r{<localized-strings>.*</localized-strings>}m, "")).to be_equivalent_to xmlpp(<<~OUTPUT)
497
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
498
+ <bibdata>
499
+ <title language="en">test</title>
500
+ <language>fr</language>
501
+ </bibdata>
502
+ <preface>
503
+ <p><stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><mn>30000</mn></math></stem>
504
+ <stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>P</mi><mfenced open="(" close=")"><mrow><mi>X</mi><mo>≥</mo><msub><mrow><mi>X</mi></mrow><mrow><mo>max</mo></mrow></msub></mrow></mfenced><mo>=</mo><munderover><mrow><mo>∑</mo></mrow><mrow><mrow><mi>j</mi><mo>=</mo><msub><mrow><mi>X</mi></mrow><mrow><mo>max</mo></mrow></msub></mrow></mrow><mrow><mn>1000</mn></mrow></munderover><mfenced open="(" close=")"><mtable><mtr><mtd><mn>1000</mn></mtd></mtr><mtr><mtd><mi>j</mi></mtd></mtr></mtable></mfenced><msup><mrow><mi>p</mi></mrow><mrow><mi>j</mi></mrow></msup><msup><mrow><mfenced open="(" close=")"><mrow><mn>0.0000032</mn><mo>−</mo><mi>p</mi></mrow></mfenced></mrow><mrow><mrow><mn>1.003</mn><mo>−</mo><mi>j</mi></mrow></mrow></msup></math></stem></p>
505
+ </preface>
506
+ </iso-standard>
507
+ INPUT
508
+ <iso-standard xmlns='http://riboseinc.com/isoxml' type='presentation'>
509
+ <bibdata>
510
+ <title language='en'>test</title>
511
+ <language current='true'>fr</language>
512
+ </bibdata>
510
513
 
511
- <preface>
512
- <p>
513
- 30'000
514
- <stem type='MathML'>
515
- <math xmlns='http://www.w3.org/1998/Math/MathML'>
516
- <mi>P</mi>
517
- <mfenced open='(' close=')'>
518
- <mrow>
519
- <mi>X</mi>
520
- <mo>&#x2265;</mo>
521
- <msub>
522
- <mrow>
523
- <mi>X</mi>
524
- </mrow>
525
- <mrow>
526
- <mo>max</mo>
527
- </mrow>
528
- </msub>
529
- </mrow>
530
- </mfenced>
531
- <mo>=</mo>
532
- <munderover>
533
- <mrow>
534
- <mo>&#x2211;</mo>
535
- </mrow>
536
- <mrow>
537
- <mrow>
538
- <mi>j</mi>
539
- <mo>=</mo>
540
- <msub>
514
+ <preface>
515
+ <p>
516
+ 30'000
517
+ <stem type='MathML'>
518
+ <math xmlns='http://www.w3.org/1998/Math/MathML'>
519
+ <mi>P</mi>
520
+ <mfenced open='(' close=')'>
541
521
  <mrow>
542
522
  <mi>X</mi>
523
+ <mo>&#x2265;</mo>
524
+ <msub>
525
+ <mrow>
526
+ <mi>X</mi>
527
+ </mrow>
528
+ <mrow>
529
+ <mo>max</mo>
530
+ </mrow>
531
+ </msub>
532
+ </mrow>
533
+ </mfenced>
534
+ <mo>=</mo>
535
+ <munderover>
536
+ <mrow>
537
+ <mo>&#x2211;</mo>
543
538
  </mrow>
544
539
  <mrow>
545
- <mo>max</mo>
540
+ <mrow>
541
+ <mi>j</mi>
542
+ <mo>=</mo>
543
+ <msub>
544
+ <mrow>
545
+ <mi>X</mi>
546
+ </mrow>
547
+ <mrow>
548
+ <mo>max</mo>
549
+ </mrow>
550
+ </msub>
551
+ </mrow>
546
552
  </mrow>
547
- </msub>
548
- </mrow>
549
- </mrow>
550
- <mrow>
551
- <mn>1'000</mn>
552
- </mrow>
553
- </munderover>
554
- <mfenced open='(' close=')'>
555
- <mtable>
556
- <mtr>
557
- <mtd>
558
- <mn>1'000</mn>
559
- </mtd>
560
- </mtr>
561
- <mtr>
562
- <mtd>
563
- <mi>j</mi>
564
- </mtd>
565
- </mtr>
566
- </mtable>
567
- </mfenced>
568
- <msup>
569
- <mrow>
570
- <mi>p</mi>
571
- </mrow>
572
- <mrow>
573
- <mi>j</mi>
574
- </mrow>
575
- </msup>
576
- <msup>
577
- <mrow>
578
- <mfenced open='(' close=')'>
579
- <mrow>
580
- <mn>0,0000032</mn>
581
- <mo>&#x2212;</mo>
582
- <mi>p</mi>
583
- </mrow>
584
- </mfenced>
585
- </mrow>
586
- <mrow>
587
- <mrow>
588
- <mn>1,003</mn>
589
- <mo>&#x2212;</mo>
590
- <mi>j</mi>
591
- </mrow>
592
- </mrow>
593
- </msup>
594
- </math>
595
- </stem>
596
- </p>
597
- </preface>
598
- </iso-standard>
599
- OUTPUT
600
- end
553
+ <mrow>
554
+ <mn>1'000</mn>
555
+ </mrow>
556
+ </munderover>
557
+ <mfenced open='(' close=')'>
558
+ <mtable>
559
+ <mtr>
560
+ <mtd>
561
+ <mn>1'000</mn>
562
+ </mtd>
563
+ </mtr>
564
+ <mtr>
565
+ <mtd>
566
+ <mi>j</mi>
567
+ </mtd>
568
+ </mtr>
569
+ </mtable>
570
+ </mfenced>
571
+ <msup>
572
+ <mrow>
573
+ <mi>p</mi>
574
+ </mrow>
575
+ <mrow>
576
+ <mi>j</mi>
577
+ </mrow>
578
+ </msup>
579
+ <msup>
580
+ <mrow>
581
+ <mfenced open='(' close=')'>
582
+ <mrow>
583
+ <mn>0,0000032</mn>
584
+ <mo>&#x2212;</mo>
585
+ <mi>p</mi>
586
+ </mrow>
587
+ </mfenced>
588
+ </mrow>
589
+ <mrow>
590
+ <mrow>
591
+ <mn>1,003</mn>
592
+ <mo>&#x2212;</mo>
593
+ <mi>j</mi>
594
+ </mrow>
595
+ </mrow>
596
+ </msup>
597
+ </math>
598
+ </stem>
599
+ </p>
600
+ </preface>
601
+ </iso-standard>
602
+ OUTPUT
603
+ end
601
604
 
602
- private
605
+ private
603
606
 
604
607
  def mock_symbols
605
608
  allow_any_instance_of(::IsoDoc::PresentationXMLConvert).to receive(:twitter_cldr_localiser_symbols).and_return(group: "'")