summaryrefslogtreecommitdiff
path: root/cell.go
diff options
context:
space:
mode:
authorxuri <xuri.me@gmail.com>2021-06-16 15:03:50 +0000
committerxuri <xuri.me@gmail.com>2021-06-16 15:03:50 +0000
commit2cfcf9eb5ff2f332dad0c6adead53ef0500001db (patch)
tree40193c6f633e587832f28d3c65d1a2ec0fc6caef /cell.go
parentc62ced7ca7a6cf715f62bd10981560a809c723dd (diff)
encode the escaped string literal which not permitted in an XML 1.0 document
Diffstat (limited to 'cell.go')
-rw-r--r--cell.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/cell.go b/cell.go
index f94b81e..4dec093 100644
--- a/cell.go
+++ b/cell.go
@@ -288,6 +288,7 @@ func (f *File) setSharedString(val string) int {
}
sst.Count++
sst.UniqueCount++
+ val = bstrMarshal(val)
t := xlsxT{Val: val}
// Leading and ending space(s) character detection.
if len(val) > 0 && (val[0] == 32 || val[len(val)-1] == 32) {
@@ -315,7 +316,7 @@ func setCellStr(value string) (t string, v string, ns xml.Attr) {
}
}
t = "str"
- v = value
+ v = bstrMarshal(value)
return
}