text.Rich to implement Stringer; extra docs
This commit is contained in:
parent
e953dbbcb1
commit
dfb60ac0eb
|
@ -7,10 +7,16 @@ type Rich struct {
|
|||
Segments []Segment
|
||||
}
|
||||
|
||||
// Empty returns whether or not the rich text is considered empty.
|
||||
func (r Rich) Empty() bool {
|
||||
return r.Content == ""
|
||||
}
|
||||
|
||||
// String returns the content. This is used mainly for printing.
|
||||
func (r Rich) String() string {
|
||||
return r.Content
|
||||
}
|
||||
|
||||
// Segment is the minimum requirement for a format segment. Frontends will use
|
||||
// this to determine when the format starts and ends. They will also assert this
|
||||
// interface to any other formatting interface, including Linker, Colorer and
|
||||
|
|
Loading…
Reference in New Issue