Beispiel #1
0
func (t *Text) ToString() string {
	switch t.Type {
	case "text":
		return html.UnescapeString(t.Body)
	case "html":
		return html.UnescapeString(sanitizer.StripTags(t.Body))
	}
	return t.Body
}
Beispiel #2
0
func atomTitle(t *atom.Text) string {
	if t == nil {
		return ""
	}
	if t.Type == "html" {
		return html.UnescapeString(sanitizer.StripTags(t.Body))
	}
	return textTitle(t.Body)
}