latex-decode 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.travis.yml +5 -5
- data/lib/latex/decode.rb +1 -1
- data/lib/latex/decode/base.rb +5 -5
- data/lib/latex/decode/maths.rb +1 -1
- data/lib/latex/decode/version.rb +1 -1
- metadata +6 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 9192df4a57585120960f5b8f6e2aba62bd900cdd8c649a15cefca04f4819f2f3
|
4
|
+
data.tar.gz: 6d692566a583b9bb70a67763c6c803f4b7e98c2e9c50b006a720cee30b39c72d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6a52d3db67061ed7c206cfa9b52d99ea181ff02bc2be8a21b6b55ebab19f8528565f3b4a882cef8c3b84f0319b99c63e5eef16d7c779ed80fc3405871bf95379
|
7
|
+
data.tar.gz: 0ac36cc1adaeff8d919ab78dc98fcecaadb663519ae6c3bd201327041a704c7e24b170f1143d700be8b999bb1561eb4c36e723b8aaf640fc4f78fb2b9ebfa5c8
|
data/.travis.yml
CHANGED
data/lib/latex/decode.rb
CHANGED
data/lib/latex/decode/base.rb
CHANGED
@@ -7,7 +7,7 @@ module LaTeX
|
|
7
7
|
class << self
|
8
8
|
attr_reader :patterns, :map
|
9
9
|
|
10
|
-
def inherited
|
10
|
+
def inherited(base)
|
11
11
|
subclasses << base
|
12
12
|
end
|
13
13
|
|
@@ -15,11 +15,11 @@ module LaTeX
|
|
15
15
|
@subclasses ||= []
|
16
16
|
end
|
17
17
|
|
18
|
-
def decode
|
18
|
+
def decode(string)
|
19
19
|
decode!(string.dup)
|
20
20
|
end
|
21
21
|
|
22
|
-
def decode!
|
22
|
+
def decode!(string)
|
23
23
|
patterns.each do |pattern|
|
24
24
|
string.gsub!(pattern) { |m| [$2,map[$1],$3].compact.join }
|
25
25
|
end
|
@@ -32,7 +32,7 @@ module LaTeX
|
|
32
32
|
|
33
33
|
module_function
|
34
34
|
|
35
|
-
def normalize
|
35
|
+
def normalize(string)
|
36
36
|
string.gsub!(/\\(?:i|j)\b/) { |m| m == '\\i' ? 'ı' : 'ȷ' }
|
37
37
|
|
38
38
|
# \foo\ bar -> \foo{} bar
|
@@ -50,7 +50,7 @@ module LaTeX
|
|
50
50
|
string
|
51
51
|
end
|
52
52
|
|
53
|
-
def strip_braces
|
53
|
+
def strip_braces(string)
|
54
54
|
string.gsub!(/(^|[^\\])([\{\}]+)/, '\1')
|
55
55
|
string.gsub!(/\\(\{|\})/, '\1')
|
56
56
|
string
|
data/lib/latex/decode/maths.rb
CHANGED
data/lib/latex/decode/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: latex-decode
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sylvester Keil
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-10-14 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Decodes strings formatted in LaTeX to equivalent Unicode strings.
|
14
14
|
email:
|
@@ -52,7 +52,7 @@ homepage: http://github.com/inukshuk/latex-decode
|
|
52
52
|
licenses:
|
53
53
|
- GPL-3.0
|
54
54
|
metadata: {}
|
55
|
-
post_install_message:
|
55
|
+
post_install_message:
|
56
56
|
rdoc_options:
|
57
57
|
- "--line-numbers"
|
58
58
|
- "--inline-source"
|
@@ -74,9 +74,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '0'
|
76
76
|
requirements: []
|
77
|
-
|
78
|
-
|
79
|
-
signing_key:
|
77
|
+
rubygems_version: 3.1.2
|
78
|
+
signing_key:
|
80
79
|
specification_version: 4
|
81
80
|
summary: Decodes LaTeX to Unicode.
|
82
81
|
test_files:
|