From 2cfcf9eb5ff2f332dad0c6adead53ef0500001db Mon Sep 17 00:00:00 2001 From: xuri Date: Wed, 16 Jun 2021 15:03:50 +0000 Subject: encode the escaped string literal which not permitted in an XML 1.0 document --- cell.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'cell.go') 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 } -- cgit v1.2.1