From 232337ff75bd420b9d12308b23af7fbb211ebc79 Mon Sep 17 00:00:00 2001 From: Phil Ewels Date: Wed, 18 Nov 2026 10:17:27 +0100 Subject: [PATCH] runnable: set FORCE_COLOR for a Python run with runnable.outputLang=ansi Co-Authored-By: Claude Opus 5.5 --- .agents/DECISIONS.md | 2 +- docs/e2e/runnable.test.ts | 17 ++++++++++-- .../src/content/docs/extend/add-a-runtime.mdx | 4 +-- docs/src/content/docs/features/run-code.mdx | 16 +++++++++-- packages/starlight-codeblocks/CHANGELOG.md | 1 + .../src/client/runnable.ts | 3 ++- packages/starlight-codeblocks/src/options.ts | 10 ++++++- .../src/runtimes/pyodide.ts | 27 ++++++++++++++----- .../references/copy-and-run.md | 2 +- 9 files changed, 65 insertions(+), 17 deletions(-) diff --git a/.agents/DECISIONS.md b/.agents/DECISIONS.md index 32afb0d..cb79652 100644 --- a/.agents/DECISIONS.md +++ b/.agents/DECISIONS.md @@ -114,7 +114,7 @@ The choices that the code does not explain, with the options that were rejected. - **Marks on lines of output come from line states**: `[!code highlight]` and the state directives mark the line in the output panel with `decorateLine()`, the code that marks lines of code, so the classes, the screen reader name and the labels are the same. The build puts each marked line in a `hidden` element in the figure, and the client clones it when the line prints. A highlight uses Expressive Code's mark colours through `scb-state-mark`. The output colours meet 4.5:1 only on the code background, so a marked line takes the text colour of its label, which meets 4.5:1 on the tint. With line states off, the state directives are unknown, as on code lines, and `[!code highlight]` on an output line warns. *Rejected:* the output colours corrected for each tint (a new setting for each state and stream); `.ec-line` elements in the panel for Expressive Code's per-theme colours (client modules and components find code lines by that class); HTML strings in a data attribute (needs `innerHTML`); a `