Allow empty texts with segments
This commit allows segments in an empty text segment to account for segments with only an image.
This commit is contained in:
parent
c7d4473c23
commit
f8c644fa7e
|
@ -11,7 +11,9 @@ func SolidColor(rgb uint32) uint32 {
|
|||
return (rgb << 8) | 0xFF
|
||||
}
|
||||
|
||||
// IsEmpty returns true if the given rich segment's content is empty.
|
||||
// IsEmpty returns true if the given rich segment's content is empty. Note that
|
||||
// a rich text is not necessarily empty if the content is empty, because there
|
||||
// may be images within the segments.
|
||||
func (r Rich) IsEmpty() bool {
|
||||
return r.Content == ""
|
||||
return r.Content == "" && len(r.Segments) == 0
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue