summaryrefslogtreecommitdiff
path: root/cell.go
diff options
context:
space:
mode:
Diffstat (limited to 'cell.go')
-rw-r--r--cell.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/cell.go b/cell.go
index a0a2818..bbbb83a 100644
--- a/cell.go
+++ b/cell.go
@@ -12,6 +12,7 @@
package excelize
import (
+ "bytes"
"encoding/xml"
"fmt"
"os"
@@ -490,7 +491,9 @@ func (c *xlsxC) setCellValue(val string) {
// string.
func (c *xlsxC) setInlineStr(val string) {
c.T, c.V, c.IS = "inlineStr", "", &xlsxSI{T: &xlsxT{}}
- c.IS.T.Val, c.IS.T.Space = trimCellValue(val)
+ buf := &bytes.Buffer{}
+ _ = xml.EscapeText(buf, []byte(val))
+ c.IS.T.Val, c.IS.T.Space = trimCellValue(buf.String())
}
// setStr set cell data type and value which containing a formula string.