summaryrefslogtreecommitdiff
path: root/lib.go
diff options
context:
space:
mode:
authorxuri <xuri.me@gmail.com>2021-08-28 09:23:44 +0800
committerxuri <xuri.me@gmail.com>2021-08-28 09:23:44 +0800
commitc3d1d7ddddd02d9d8d39204dd891250222bb9ee4 (patch)
treeb98929deef6a8f2b23049209c218c8aa224bd6ac /lib.go
parent7d9b9275bd14556bfcaab7f1d3690b1e54ab75e8 (diff)
Preserve XML control character in bstrUnmarshal result
Diffstat (limited to 'lib.go')
-rw-r--r--lib.go15
1 files changed, 1 insertions, 14 deletions
diff --git a/lib.go b/lib.go
index 424d3f9..31b64a5 100644
--- a/lib.go
+++ b/lib.go
@@ -21,7 +21,6 @@ import (
"regexp"
"strconv"
"strings"
- "unicode"
)
// ReadZipReader can be used to read the spreadsheet in memory without touching the
@@ -588,10 +587,6 @@ func bstrUnmarshal(s string) (result string) {
subStr := s[match[0]:match[1]]
if subStr == "_x005F_" {
cursor = match[1]
- if l > match[1]+6 && !bstrEscapeExp.MatchString(s[match[1]:match[1]+6]) {
- result += subStr
- continue
- }
result += "_"
continue
}
@@ -607,15 +602,7 @@ func bstrUnmarshal(s string) (result string) {
result += subStr
continue
}
- hasRune := false
- for _, c := range v {
- if unicode.IsControl(c) {
- hasRune = true
- }
- }
- if !hasRune {
- result += v
- }
+ result += v
}
}
if cursor < l {