(b64)
| 8 | import { escapeHtml } from './shiki' |
| 9 | |
| 10 | function fromB64(b64) { |
| 11 | if (!b64) return '' |
| 12 | try { |
| 13 | return new TextDecoder().decode(Uint8Array.from(atob(b64), (c) => c.charCodeAt(0))) |
| 14 | } catch { |
| 15 | return '' |
| 16 | } |
| 17 | } |
| 18 | |
| 19 | // Terminal control chars: `\r`/`\b`/`\t`/`\f` move the cursor and `\n` breaks the line. |
| 20 | function applyTerminalControls(text) { |