forked from p30928647/excelize
solve ending space missing
This commit is contained in:
parent
a00ba75f0f
commit
810139f5fc
2
cell.go
2
cell.go
|
@ -229,7 +229,7 @@ func (f *File) SetCellStr(sheet, axis, value string) error {
|
||||||
value = value[0:32767]
|
value = value[0:32767]
|
||||||
}
|
}
|
||||||
// Leading space(s) character detection.
|
// 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{
|
cellData.XMLSpace = xml.Attr{
|
||||||
Name: xml.Name{Space: NameSpaceXML, Local: "space"},
|
Name: xml.Name{Space: NameSpaceXML, Local: "space"},
|
||||||
Value: "preserve",
|
Value: "preserve",
|
||||||
|
|
Loading…
Reference in New Issue