예제 #1
0
파일: atom.go 프로젝트: hobeone/rss2go
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
}
예제 #2
0
파일: utils.go 프로젝트: kissthink/goread
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)
}