From 5a0d885315521a4e703f9de401e2dda834285d5f Mon Sep 17 00:00:00 2001 From: xuri Date: Wed, 24 Feb 2021 00:37:44 +0800 Subject: handle default underline type on get rich text; #65 fn: CODE, COLUMN, FIND, FINDB --- cell.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'cell.go') diff --git a/cell.go b/cell.go index 892a906..912ee6a 100644 --- a/cell.go +++ b/cell.go @@ -519,11 +519,14 @@ func (f *File) GetCellRichText(sheet, cell string) (runs []RichTextRun, err erro Text: v.T.Val, } if nil != v.RPr { - font := Font{} + font := Font{Underline: "none"} font.Bold = v.RPr.B != nil font.Italic = v.RPr.I != nil - if v.RPr.U != nil && v.RPr.U.Val != nil { - font.Underline = *v.RPr.U.Val + if v.RPr.U != nil { + font.Underline = "single" + if v.RPr.U.Val != nil { + font.Underline = *v.RPr.U.Val + } } if v.RPr.RFont != nil && v.RPr.RFont.Val != nil { font.Family = *v.RPr.RFont.Val -- cgit v1.2.1