diff --git a/text/text_extras.go b/text/text_extras.go index 143d827..9272e96 100644 --- a/text/text_extras.go +++ b/text/text_extras.go @@ -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 }