TestEventDoneFlushesStreamingThroughGlamour: EventDone moves raw streamed text into the committed scroll via the Markdown renderer and empties the streaming buffer. After Done, scroll contains the rendered block and the streaming buffer is empty.
(t *testing.T)
| 2476 | // stripANSI removes CSI escape sequences (`\x1b[…m`) so tests can match the |
| 2477 | // visible text through glamour's per-word styling, which splits "foo bar" into |
| 2478 | // `<span>foo</span> <span>bar</span>` and breaks a naive Contains("foo bar"). |
| 2479 | func stripANSI(s string) string { |
| 2480 | var b strings.Builder |
| 2481 | for i := 0; i < len(s); i++ { |
| 2482 | if s[i] == 0x1b && i+1 < len(s) && s[i+1] == '[' { |
| 2483 | for j := i + 2; j < len(s); j++ { |
| 2484 | if s[j] >= 0x40 && s[j] <= 0x7e { |
| 2485 | i = j |
| 2486 | break |
| 2487 | } |
| 2488 | } |
| 2489 | continue |
| 2490 | } |
| 2491 | b.WriteByte(s[i]) |
| 2492 | } |
| 2493 | return b.String() |
nothing calls this directly
no test coverage detected