mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #1830] [CLOSED] Add locally bundled KaTeX rendering to web chat #3707
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#3707
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/1830
Author: @CC-David-CC
Created: 10/10/2026
Status: ❌ Closed
Base:
main← Head:feat/web-math-katex📝 Commits (6)
56063f3web: isolate shared chat math foundation and adapter contract741bd8bweb: render chat math with locally bundled KaTeX60721bddocs: distinguish Docker installation from pending native TeX validation253ea8cMerge remote-tracking branch 'upstream/main' into HEAD2312803Merge commit '253ea8cfe5' into HEADe1fefc1Merge Strata v0.1.43 into feat/web-math-katex📊 Changes
48 files changed (+1593 additions, -4 deletions)
View changed files
➕
docs/WEB_MATH.md(+66 -0)➕
docs/WEB_MATH_COMPARISON.md(+91 -0)➕
docs/WEB_MATH_INTERFACE.md(+22 -0)➕
docs/web-math-results/katex-chromium.json(+81 -0)➕
docs/web-math-results/katex-firefox.json(+81 -0)➕
docs/web-math-results/katex-webkit.json(+81 -0)➕
docs/web-math-results/mathjax-chromium.json(+81 -0)➕
docs/web-math-results/mathjax-firefox.json(+81 -0)➕
docs/web-math-results/mathjax-webkit.json(+81 -0)➕
docs/web-math-results/tex-chromium.json(+82 -0)➕
docs/web-math-results/tex-firefox.json(+82 -0)➕
docs/web-math-results/tex-linux-chromium.json(+82 -0)➕
docs/web-math-results/tex-runtime.json(+15 -0)➕
docs/web-math-results/tex-webkit.json(+82 -0)➕
docs/web-math-results/tex-worker.json(+86 -0)➕
serve/fixtures/math.json(+12 -0)📝
serve/server.py(+18 -0)📝
serve/web/app.css(+8 -0)📝
serve/web/app.js(+18 -4)📝
serve/web/index.html(+4 -0)...and 28 more files
📄 Description
Depends on #1829 (shared LaTeX/web math core). This branch builds on that core; its commits remain visible against main until the core merges. Addresses #1769 and #1780.
Replaces the placeholder adapter with KaTeX 0.19.0. Enable Render math in Chat's sampling drawer and Apply to typeset inline and display equations. Rendering starts disabled. Code stays literal; invalid or unsupported equations retain their source. Copy, export, history, and model requests preserve the original text.
Bundles JavaScript, CSS, WOFF2 fonts, license, and provenance: 558,806 bytes (about 0.56 MB). No CDN or TeX installation is required. Uses HTML plus semantic MathML, untrusted input, isolated macros, bounded expansion, and bounded requested sizes.
Validated in Chromium, Firefox, and Playwright WebKit on Windows, including streaming, currency/code handling, macro isolation, deadlines, stale results, source preservation, and narrow layouts. WebKit coverage is not a physical Safari/iPhone test; semantic markup checks are not a manual screen-reader audit.
This is the lightweight first renderer. MathJax and full TeX remain separate alternatives. Adapter-only diff. Usage, reproduction commands, and size/feature comparisons are in docs/WEB_MATH.md and docs/WEB_MATH_COMPARISON.md.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.