isodoc 1.8.3 → 1.8.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -101,8 +101,8 @@ RSpec.describe IsoDoc do
101
101
  </termexample>
102
102
  <termsource status="identical">[SOURCE: <origin citeas="">
103
103
  <termref base="IEV" target="xyz">t1</termref>
104
- </origin>, modified]</termsource>;
105
- <termsource status="modified">[SOURCE: <origin citeas="">
104
+ </origin>, modified ;
105
+ <origin citeas="">
106
106
  <termref base="IEV" target="xyz"/>
107
107
  </origin>, modified
108
108
  &#x2013;
@@ -155,8 +155,8 @@ RSpec.describe IsoDoc do
155
155
  <li>A</li>
156
156
  </ul>
157
157
  </div>
158
- <p>[SOURCE: t1, modified]</p>;
159
- <p>[SOURCE: Termbase IEV, term ID xyz, modified
158
+ <p>[SOURCE: t1, modified ;
159
+ Termbase IEV, term ID xyz, modified
160
160
  &#8211;
161
161
  with adjustments]</p>
162
162
  <p class="TermNum" id="paddy">1.2.</p><p class="Terms" style="text-align:left;"><b>paddy</b></p>
@@ -197,8 +197,8 @@ RSpec.describe IsoDoc do
197
197
  <li>A</li>
198
198
  </ul>
199
199
  </div>
200
- <p>[SOURCE: t1, modified]</p>;
201
- <p>[SOURCE: Termbase IEV, term ID xyz, modified
200
+ <p>[SOURCE: t1, modified ;
201
+ Termbase IEV, term ID xyz, modified
202
202
  &#8211;
203
203
  with adjustments]</p>
204
204
  <p class="TermNum" id="paddy">1.2.</p><p class="Terms" style="text-align:left;"><b>paddy</b></p>
@@ -321,9 +321,7 @@ RSpec.describe IsoDoc do
321
321
  <termsource status='identical'>[SOURCE:
322
322
  <origin citeas=''>
323
323
  <termref base='IEV' target='xyz'>t1</termref>
324
- </origin>]
325
- </termsource>;
326
- <termsource status='modified'>[SOURCE:
324
+ </origin>;
327
325
  <origin citeas=''>
328
326
  <termref base='IEV' target='xyz'/>
329
327
  </origin>, modified &#x2013; with adjustments]
@@ -0,0 +1,57 @@
1
+ require "spec_helper"
2
+
3
+ RSpec.describe IsoDoc::ClassUtils do
4
+ it "cases text" do
5
+ expect(::IsoDoc::Common.case_strict("ABC CDE", "lowercase", "Hans"))
6
+ .to eq "ABC CDE"
7
+ expect(::IsoDoc::Common.case_strict("ABC CDE", "lowercase", "Latn"))
8
+ .to eq "aBC CDE"
9
+ expect(::IsoDoc::Common.case_strict("abc cde", "capital", "Latn"))
10
+ .to eq "Abc cde"
11
+ expect(::IsoDoc::Common.case_strict("abc cde", "allcaps", "Latn"))
12
+ .to eq "ABC cde"
13
+ expect(::IsoDoc::Common.case_strict("ABC CDE", "lowercase", "Hans", firstonly: true))
14
+ .to eq "ABC CDE"
15
+ expect(::IsoDoc::Common.case_strict("ABC CDE", "lowercase", "Latn", firstonly: true))
16
+ .to eq "aBC CDE"
17
+ expect(::IsoDoc::Common.case_strict("abc cde", "capital", "Latn", firstonly: true))
18
+ .to eq "Abc cde"
19
+ expect(::IsoDoc::Common.case_strict("abc cde", "allcaps", "Latn", firstonly: true))
20
+ .to eq "ABC cde"
21
+ expect(::IsoDoc::Common.case_strict("ABC CDE", "lowercase", "Hans", firstonly: false))
22
+ .to eq "ABC CDE"
23
+ expect(::IsoDoc::Common.case_strict("ABC CDE", "lowercase", "Latn", firstonly: false))
24
+ .to eq "aBC cDE"
25
+ expect(::IsoDoc::Common.case_strict("abc cde", "capital", "Latn", firstonly: false))
26
+ .to eq "Abc Cde"
27
+ expect(::IsoDoc::Common.case_strict("abc cde", "allcaps", "Latn", firstonly: false))
28
+ .to eq "ABC CDE"
29
+ end
30
+
31
+ it "cases text with formatting" do
32
+ expect(::IsoDoc::Common
33
+ .case_with_markup("<a>ABC</a> CDE", "lowercase", "Hans"))
34
+ .to eq "<a>ABC</a> CDE"
35
+ expect(::IsoDoc::Common
36
+ .case_with_markup("<a>ABC</a> CDE", "lowercase", "Latn"))
37
+ .to eq "<a>aBC</a> CDE"
38
+ expect(::IsoDoc::Common
39
+ .case_with_markup("<a>abc</a> cde", "capital", "Latn"))
40
+ .to eq "<a>Abc</a> cde"
41
+ expect(::IsoDoc::Common
42
+ .case_with_markup("<a>abc</a> cde", "allcaps", "Latn"))
43
+ .to eq "<a>ABC</a> cde"
44
+ expect(::IsoDoc::Common
45
+ .case_with_markup("<a>ABC</a> CDE", "lowercase", "Hans", firstonly: false))
46
+ .to eq "<a>ABC</a> CDE"
47
+ expect(::IsoDoc::Common
48
+ .case_with_markup("<a>ABC</a> CDE", "lowercase", "Latn", firstonly: false))
49
+ .to eq "<a>aBC</a> cDE"
50
+ expect(::IsoDoc::Common
51
+ .case_with_markup("<a>abc</a> cde", "capital", "Latn", firstonly: false))
52
+ .to eq "<a>Abc</a> Cde"
53
+ expect(::IsoDoc::Common
54
+ .case_with_markup("<a>abc</a> cde", "allcaps", "Latn", firstonly: false))
55
+ .to eq "<a>ABC</a> CDE"
56
+ end
57
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: isodoc
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.3
4
+ version: 1.8.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-12-13 00:00:00.000000000 Z
11
+ date: 2021-12-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: asciimath
@@ -509,6 +509,7 @@ files:
509
509
  - spec/isodoc/section_spec.rb
510
510
  - spec/isodoc/table_spec.rb
511
511
  - spec/isodoc/terms_spec.rb
512
+ - spec/isodoc/utils_spec.rb
512
513
  - spec/isodoc/xref_numbering_spec.rb
513
514
  - spec/isodoc/xref_spec.rb
514
515
  - spec/isodoc/xslfo_convert_spec.rb