You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
STML: syntax highlighting for <code> blocks in agent notes #1219
A lang attribute on STML <code> / <pre> so the block body is syntax highlighted, e.g. <code title="suggestion" lang="ts">. A diff language (or an opt-in that colors -/+ lines) would cover the "here is the suggested change" shape too.
Today lang is ignored (only title is read), and <c color="..."> inside <code> or <pre> prints literally, since both are raw-text roles.
The first prints the line unhighlighted; the second prints the <c> tag as text.
Why?
I use agent notes to carry suggested changes and before/after snippets next to the diff, when reviewing TS code. Syntax highlighting makes reviewing code and certain parts I don't understand easier for me. The <code> box is the right container, but a 15-line TypeScript suggestion sits unhighlighted directly under a fully highlighted diff pane, so it reads as a wall of text. The workaround is a box of <text> lines with <c> tags for color, which loses indentation and the code-block frame.
How? (optional)
Run the body through the Shiki highlighter the diff pane already uses, with the active theme, when lang is present. Unknown languages fall back to today's plain rendering.
Activity