(s *bufio.Scanner)
| 297 | } |
| 298 | |
| 299 | func scanMessageTitle(s *bufio.Scanner) (title string, indent string) { |
| 300 | var b strings.Builder |
| 301 | for i := 0; s.Scan(); i++ { |
| 302 | line := s.Text() |
| 303 | trimLine := strings.TrimSpace(line) |
| 304 | if trimLine == "" { |
| 305 | break |
| 306 | } |
| 307 | |
| 308 | if i == 0 { |
| 309 | if start := strings.IndexFunc(line, func(c rune) bool { return !unicode.IsSpace(c) }); start > 0 { |
| 310 | indent = line[:start] |
| 311 | } |
| 312 | } |
| 313 | if b.Len() > 0 { |
| 314 | b.WriteByte(' ') |
| 315 | } |
| 316 | b.WriteString(trimLine) |
| 317 | } |
| 318 | return b.String(), indent |
| 319 | } |
| 320 | |
| 321 | func scanMessageBody(s *bufio.Scanner, indent string, separateAppendix bool) (string, string) { |
| 322 | // Body and appendix |
no test coverage detected