[PR #1830] [CLOSED] Add locally bundled KaTeX rendering to web chat #3707

Closed
opened 2026-11-07 15:30:12 +07:00 by bsakaguchi · 0 comments
Owner

📋 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)

  • 56063f3 web: isolate shared chat math foundation and adapter contract
  • 741bd8b web: render chat math with locally bundled KaTeX
  • 60721bd docs: distinguish Docker installation from pending native TeX validation
  • 253ea8c Merge remote-tracking branch 'upstream/main' into HEAD
  • 2312803 Merge commit '253ea8cfe5' into HEAD
  • e1fefc1 Merge 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.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/1830 **Author:** [@CC-David-CC](https://github.com/CC-David-CC) **Created:** 10/10/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `feat/web-math-katex` --- ### 📝 Commits (6) - [`56063f3`](https://github.com/Niko1221/Strata/commit/56063f315e3975294e67ac4f9e40ef7cd5a6a5c4) web: isolate shared chat math foundation and adapter contract - [`741bd8b`](https://github.com/Niko1221/Strata/commit/741bd8b99b963742338e237cafd1349af2050ae3) web: render chat math with locally bundled KaTeX - [`60721bd`](https://github.com/Niko1221/Strata/commit/60721bd4614d752d0071c8dc7e6d768bed27c959) docs: distinguish Docker installation from pending native TeX validation - [`253ea8c`](https://github.com/Niko1221/Strata/commit/253ea8cfe554f45f1a0ca287b9880363d3b16012) Merge remote-tracking branch 'upstream/main' into HEAD - [`2312803`](https://github.com/Niko1221/Strata/commit/2312803cc4488bc2c02f7173f6a350f45b582ea5) Merge commit '253ea8cfe554f45f1a0ca287b9880363d3b16012' into HEAD - [`e1fefc1`](https://github.com/Niko1221/Strata/commit/e1fefc11580caadde7622c0d1ce77c5437abf563) Merge Strata v0.1.43 into feat/web-math-katex ### 📊 Changes **48 files changed** (+1593 additions, -4 deletions) <details> <summary>View changed files</summary> ➕ `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_ </details> ### 📄 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](https://github.com/CC-David-CC/Strata-a5500/compare/feat/web-math-common...feat/web-math-katex). Usage, reproduction commands, and size/feature comparisons are in docs/WEB_MATH.md and docs/WEB_MATH_COMPARISON.md. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 15:30:12 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#3707
No description provided.