summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxuri <xuri.me@gmail.com>2019-10-10 22:40:37 +0800
committerGitHub <noreply@github.com>2019-10-10 22:40:37 +0800
commitaf100372a0823e9eb6cc9caa722a64c33975cce7 (patch)
tree28c856b7b9adedcc427ff2c0ad95c790d552b8b9
parenta00ba75f0f294ce04bfe8d25703d13cd27d6284f (diff)
parent810139f5fc46b1002c0998379b18af3d2feffbb7 (diff)
Merge pull request #498 from heiy/master
solve ending space missing
-rw-r--r--cell.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/cell.go b/cell.go
index f9868de..ab42b72 100644
--- a/cell.go
+++ b/cell.go
@@ -229,7 +229,7 @@ func (f *File) SetCellStr(sheet, axis, value string) error {
value = value[0:32767]
}
// Leading space(s) character detection.
- if len(value) > 0 && value[0] == 32 {
+ if len(value) > 0 && (value[0] == 32 || value[len(value)-1] == 32) {
cellData.XMLSpace = xml.Attr{
Name: xml.Name{Space: NameSpaceXML, Local: "space"},
Value: "preserve",