Fix currency text triggering KaTeX math in Excel add-in thinking blocks
Session from pi-for-excel-sessions on Hugging Face by thomasmustier · MIT · condensed by Coders Talk
Click a segment to jump to that moment
31msession
1interventions
GOAL
Diagnose a rendering glitch where currency figures like $16,055M appeared italic/mangled inside thinking blocks, then fix and ship it.
- +0Prompt · +0Diagnose a strange font rendering behaviour inside a thinking block, with a screenshot attached.
- +0mAgent did · +0mTraced the rendering through message-list/thinking-block components down to markdown-block's KaTeX inline math extension, found it treats $...$ currency text as math delimiters.
- +4mAgent did · +4mConcluded diagnosis: dollar-delimited currency values (e.g. $16,055M) collide with KaTeX inline math regex in mini-lit's MarkdownBlock, causing italic/mangled rendering.
- +17mPrompt · +17mConfirmed the diagnosis and asked to implement the fix, open a PR, wait for automated review, then merge and consider refactor opportunities, using an isolated worktree.
- +17mAgent did · +17mInvestigated marked's extension API and existing marked-safety.ts/marked-safety-policy.ts patch files, set up an isolated git worktree on a new branch tracking origin/main.
- +19mAgent did · +19mEdited marked-safety-policy.ts and marked-safety.ts to disable dollar-delimited KaTeX math extensions at boot while keeping LaTeX \(...\) delimiters, added a policy test, ran lint/typecheck/build/security tests, and committed.
- +22mAgent did · +22mPushed the branch and opened PR #405 via gh, then reran the full check/build/security suite in the worktree to confirm green.
- +23mAgent did · +23mPolled for the automated Codex PR review per instructions (sleep 240s then poll every 60s), found no review activity after several checks.
- +30mIntervention · +30mDeveloper merged the PR manually instead of waiting further for the automated review.Why: No review had shown up after the polling window and checks were green, so I just merged it myself.
- +30mAgent did · +30mVerified PR #405 merged, reviewed the diff for further refactor opportunities (decided the fix was already minimal), then cleaned up the worktree and deleted the local and remote feature branch.
- +31mOutcome · +31mPR #405 merged to main: disabled dollar-delimited KaTeX extensions in 3 files, added policy test coverage, worktree and branches cleaned up.
VERDICT
Next time I'd start the prompt by pointing straight at markdown-block's KaTeX inline math extension instead of letting the agent rediscover it through a long grep trail — that diagnosis phase took way longer than the actual fix. The one correction that mattered was me merging manually once checks were green and no review showed up after the polling window, rather than letting the agent keep polling indefinitely. Otherwise the agent handled the worktree isolation, fix, tests, and cleanup well on its own.