mirror of
https://github.com/diamondburned/cchat-gtk.git
synced 2024-11-16 03:02:45 +00:00
23 lines
441 B
Go
23 lines
441 B
Go
package rich
|
|
|
|
import (
|
|
"html"
|
|
|
|
"github.com/diamondburned/cchat/text"
|
|
)
|
|
|
|
func Small(text string) string {
|
|
return `<span size="small" color="#808080">` + text + "</span>"
|
|
}
|
|
|
|
func MakeRed(content text.Rich) string {
|
|
return `<span color="red">` + html.EscapeString(content.Content) + `</span>`
|
|
}
|
|
|
|
// used for grabbing text without changing state
|
|
type nullLabel struct {
|
|
text.Rich
|
|
}
|
|
|
|
func (n *nullLabel) SetLabel(t text.Rich) { n.Rich = t }
|