(title string)
| 96 | } |
| 97 | |
| 98 | func cutLongTitle(title string) string { |
| 99 | maxBytes := 150 |
| 100 | if len(title) <= maxBytes { |
| 101 | return title |
| 102 | } |
| 103 | |
| 104 | truncated := title[:maxBytes] |
| 105 | for len(truncated) > 0 && !utf8.ValidString(truncated) { |
| 106 | truncated = truncated[:len(truncated)-1] |
| 107 | } |
| 108 | return truncated |
| 109 | } |
| 110 | |
| 111 | // FetchExcerpt return the excerpt from the HTML string |
| 112 | func FetchExcerpt(html, trimMarker string, limit int) (text string) { |
no outgoing calls