Skip to content

renderBufferToHTML

renderBufferToHTML(buffer): string

Defined in: src/render/html-renderer.ts:129

Render the screen buffer as styled HTML, in two stacked layers:

  1. a background layer (cell fills), absolutely positioned behind, and
  2. a foreground text layer on top.

The page applies a hard CSS reset (no margins) and the grid sets line-height: HTML_LINE_HEIGHT, so each row’s height comes from the line box alone (no explicit height on the row divs) and the cell is HTML_CELL_HEIGHT px tall. Glyph descenders can still spill a pixel into the next row; keeping every cell fill behind all text (the background layer) means the next row’s fill never paints over and clips those tails. No per-cell inline-block is used — every cell is a plain glyph in a white-space: pre row.

ScreenBuffer

string