xlsxtream 3.0.0 → 3.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/xlsxtream/version.rb +1 -1
- data/lib/xlsxtream/xml.rb +8 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '08866e063a1979a9dfb695f2bf85bd97536b85da709ee87b107bb534930009fd'
|
4
|
+
data.tar.gz: 4673dab9359e7abf3f85e8e44ac5927a4cf60bdb0e0b39ba3efcd11a17e56a74
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d258aaa70f61c283fde88bff75649f799e3be874f5535d5dc292785598a15e5540a3c15a5110b9517b294d6c801725a9102575b26651e11df7a37d267edfb50f
|
7
|
+
data.tar.gz: 3155c759ec706520684d4939be31470b1fe8da68252bab072dbbf6b0449bdc9eaff553568d994b8a5d3ae3841ca05edb186a61bfc7c541e8a3a1f848319b2962
|
data/CHANGELOG.md
CHANGED
data/lib/xlsxtream/version.rb
CHANGED
data/lib/xlsxtream/xml.rb
CHANGED
@@ -8,6 +8,10 @@ module Xlsxtream
|
|
8
8
|
'>' => '>',
|
9
9
|
}.freeze
|
10
10
|
|
11
|
+
# Escape first underscore of ST_Xstring sequences in input strings to appear as plaintext in Excel
|
12
|
+
HEX_ESCAPE_REGEXP = /_(x[0-9A-Fa-f]{4}_)/.freeze
|
13
|
+
XML_ESCAPE_UNDERSCORE = '_x005f_\1'.freeze
|
14
|
+
|
11
15
|
XML_DECLARATION = %'<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r\n'.freeze
|
12
16
|
|
13
17
|
WS_AROUND_TAGS = /(?<=>)\s+|\s+(?=<)/.freeze
|
@@ -37,7 +41,10 @@ module Xlsxtream
|
|
37
41
|
end
|
38
42
|
|
39
43
|
def escape_value(string)
|
40
|
-
string
|
44
|
+
string
|
45
|
+
.gsub(UNSAFE_VALUE_CHARS, XML_ESCAPES)
|
46
|
+
.gsub(HEX_ESCAPE_REGEXP, XML_ESCAPE_UNDERSCORE)
|
47
|
+
.gsub(INVALID_XML10_CHARS, &ESCAPE_CHAR)
|
41
48
|
end
|
42
49
|
|
43
50
|
end
|