Added rich.Empty

This commit adds rich.Empty for convenience. It describes an empty text
segment.
This commit is contained in:
diamondburned 2020-09-05 10:51:02 -07:00 committed by diamondburned
parent cd018ef8f9
commit 4239dc47c4
1 changed files with 3 additions and 0 deletions

View File

@ -7,6 +7,9 @@ type Rich struct {
Segments []Segment
}
// Empty describes an empty rich text segment with no formatting.
var Empty = Rich{}
// Plain creates a rich text with no formatting.
func Plain(text string) Rich {
return Rich{Content: text}