Serialize highlighted code spans into ANSI text, preserving a row background when present.
(spans: RenderSpan[], rowBg: string)
| 70 | |
| 71 | /** Serialize highlighted code spans into ANSI text, preserving a row background when present. */ |
| 72 | function serializeSpans(spans: RenderSpan[], rowBg: string) { |
| 73 | return spans.map((span) => colorText(span.text, span.fg, span.bg ?? rowBg)).join(""); |
| 74 | } |
| 75 | |
| 76 | /** Serialize spans into one fixed-width pane so split rows keep both sides aligned. */ |
| 77 | function serializeSpansFixedWidth(spans: RenderSpan[], rowBg: string, width: number) { |
no test coverage detected