stripQuotedReplies cuts the text at the first quoted-reply / forwarded marker and removes any trailing ">"-quoted lines. Conservative: only well-known markers trigger a cut (over-stripping is acceptable; raw is always available).
(text string)
| 265 | // and removes any trailing ">"-quoted lines. Conservative: only well-known |
| 266 | // markers trigger a cut (over-stripping is acceptable; raw is always available). |
| 267 | func stripQuotedReplies(text string) string { |
| 268 | if loc := quoteMarker.FindStringIndex(text); loc != nil { |
| 269 | text = text[:loc[0]] |
| 270 | } |
| 271 | return strings.TrimRight(text, " \t\r\n") |
| 272 | } |
| 273 | |
| 274 | // normalizeWhitespace collapses runs of blank lines and trims trailing spaces |
| 275 | // per line, so the parsed view is compact without losing paragraph structure. |