Repository navigation
Render Mermaid diagrams and LaTeX math in chat - #1
Merged
Merged
Conversation
Co-authored-by: maria-rcks <254055478+maria-rcks@users.noreply.github.com>
Typeset $…$, $$…$$, \(…\) and \[…\] in chat and Markdown previews behind Settings → Appearance → Render math (off by default). Math is parsed by a micromark construct, so code, links, escapes and source offsets keep their CommonMark meaning; KaTeX loads lazily only when a formula renders. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
A `$$` or `\[` block needs its closing line before it typesets, so a formula arriving token by token no longer flips between KaTeX output and source on every prefix. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Upstream keeps math opt-in. This fork is for a user who wants it on, so flip the client-setting default; Settings → Appearance can still turn it off. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
"It costs $5 and $10, and `$HOME`" turned "$5 … `$" into a broken formula and swallowed the code span, because inline math scanned straight through the backtick to the `$` inside it. A formula now gives up at a backtick, so the code span wins as CommonMark precedence says it should. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Makes T3 render Mermaid diagrams and LaTeX math in chat, on top of the v0.0.45 release (the
aidenbranch).What's in it (all cherry-picked from upstream, credit to their authors):
$…$,$$…$$,\(…\)and\[…\]. Dollar amounts and code stay as they are.It costs $5 and $10, and \$HOME`` became a broken formula that swallowed the code span. An inline formula now gives up at a backtick, so the code span wins, as CommonMark precedence says it should. Regression tests added.FORK.md+scripts/fork-build-linux.sh: how the AppImage is built. Its updater points at this fork's releases, so an upstream update can't silently drop the patches.Backport conflicts resolved by hand
markdown-clipboard.ts: one copy branch now handles both formulas and diagrams.MermaidDiagram.tsx: kept the math PR's class and added the copy attributes.MessagesTimeline.test.tsxaddition depended on test scaffolding that v0.0.45 doesn't have, so it was dropped. The one-line source fix it covers is kept.Verification
apps/webtypecheck passes..env.localwith the client config breaks threeconnectCliAuthtests, so the build script reads that config from~/.configinstead.)$HOMEas<code>, in dark and light themes.app-update.ymlpoints at this fork, and the app reconnected to both homelab environments.🤖 Generated with Claude Code