Avoid stray control characters

This commit is contained in:
Jared Miller 2026-01-31 09:05:33 -05:00
parent a8a73aad4e
commit f2c3f6f067
Signed by: shmup
GPG key ID: 22B5C6D66A38B06C

View file

@ -274,6 +274,12 @@ export function ansiToHtml(text: string): string {
continue;
}
// Backspace: drop it to avoid stray control characters in HTML output
if (text[i] === "\b") {
i++;
continue;
}
// Track newlines and carriage returns
if (text[i] === "\n") {
// Close span before newline to prevent background color bleeding