From dc5a0b582d8c4cd2c01772716238b601b7249628 Mon Sep 17 00:00:00 2001 From: Aliou Diallo Date: Thu, 5 Feb 2026 02:10:05 +0100 Subject: [PATCH] fix(coding-agent): preserve indentation in ANSI-rendered HTML export HTML div elements collapse whitespace by default, stripping leading spaces from ANSI-rendered tool output (e.g. JSON code blocks). Added white-space: pre-wrap to .ansi-line class. --- packages/coding-agent/CHANGELOG.md | 4 ++++ packages/coding-agent/src/core/export-html/template.css | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/packages/coding-agent/CHANGELOG.md b/packages/coding-agent/CHANGELOG.md index 46805a0e..e4682cce 100644 --- a/packages/coding-agent/CHANGELOG.md +++ b/packages/coding-agent/CHANGELOG.md @@ -7,6 +7,10 @@ - API keys in `auth.json` now support shell command resolution (`!command`) and environment variable lookup, matching the behavior in `models.json` - Added `minimal-mode.ts` example extension demonstrating how to override built-in tool rendering for a minimal display mode +### Fixed + +- Fixed HTML export losing indentation in ANSI-rendered tool output (e.g. JSON code blocks in custom tool results) + ## [0.51.6] - 2026-02-04 ### New Features diff --git a/packages/coding-agent/src/core/export-html/template.css b/packages/coding-agent/src/core/export-html/template.css index d64cc068..bbf8e326 100644 --- a/packages/coding-agent/src/core/export-html/template.css +++ b/packages/coding-agent/src/core/export-html/template.css @@ -503,6 +503,10 @@ display: block; } + .ansi-line { + white-space: pre-wrap; + } + .tool-images { }