From 66d0272f6af59b5f0c97a304379a795420a43e8b Mon Sep 17 00:00:00 2001 From: xuri Date: Mon, 6 Apr 2020 00:23:27 +0800 Subject: Resolve #172, init rich text support --- comment.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'comment.go') diff --git a/comment.go b/comment.go index 610eae8..e224502 100644 --- a/comment.go +++ b/comment.go @@ -50,7 +50,9 @@ func (f *File) GetComments() (comments map[string][]Comment) { sheetComment.Text += *comment.Text.T } for _, text := range comment.Text.R { - sheetComment.Text += text.T + if text.T != nil { + sheetComment.Text += text.T.Val + } } sheetComments = append(sheetComments, sheetComment) } @@ -263,7 +265,7 @@ func (f *File) addComment(commentsXML, cell string, formatSet *formatComment) { RFont: &attrValString{Val: stringPtr(defaultFont)}, Family: &attrValInt{Val: intPtr(2)}, }, - T: a, + T: &xlsxT{Val: a}, }, { RPr: &xlsxRPr{ @@ -274,7 +276,7 @@ func (f *File) addComment(commentsXML, cell string, formatSet *formatComment) { RFont: &attrValString{Val: stringPtr(defaultFont)}, Family: &attrValInt{Val: intPtr(2)}, }, - T: t, + T: &xlsxT{Val: t}, }, }, }, -- cgit v1.2.1