formatBody returns an excerpt of the given raw note content and a boolean indicating if the returned string has been excertped
(noteBody string)
| 52 | // formatBody returns an excerpt of the given raw note content and a boolean |
| 53 | // indicating if the returned string has been excertped |
| 54 | func formatBody(noteBody string) (string, bool) { |
| 55 | trimmed := strings.TrimRight(noteBody, "\r\n") |
| 56 | newlineIdx := getNewlineIdx(trimmed) |
| 57 | |
| 58 | if newlineIdx > -1 { |
| 59 | ret := strings.Trim(trimmed[0:newlineIdx], " ") |
| 60 | |
| 61 | return ret, true |
| 62 | } |
| 63 | |
| 64 | return strings.Trim(trimmed, " "), false |
| 65 | } |
| 66 | |
| 67 | func printBookLine(w io.Writer, info bookInfo, nameOnly bool) { |
| 68 | if nameOnly { |