Split returns the live (title, body) from the textarea content. First non-empty line is the title; the rest (skipping one separator blank) is the body.
()
| 78 | // non-empty line is the title; the rest (skipping one separator blank) |
| 79 | // is the body. |
| 80 | func (e *Editor) Split() (string, string) { |
| 81 | val := e.Ta.Value() |
| 82 | lines := strings.SplitN(val, "\n", 2) |
| 83 | if len(lines) == 0 { |
| 84 | return "", "" |
| 85 | } |
| 86 | title := strings.TrimSpace(lines[0]) |
| 87 | if len(lines) == 1 { |
| 88 | return title, "" |
| 89 | } |
| 90 | rest := lines[1] |
| 91 | if strings.HasPrefix(rest, "\n") { |
| 92 | rest = rest[1:] |
| 93 | } |
| 94 | return title, rest |
| 95 | } |
| 96 | |
| 97 | // View composes: blurred backdrop → ornate canvas frame at target rect → |
| 98 | // textarea spliced inside the frame → footer. |
no outgoing calls
no test coverage detected