Goal
Render inline (`$...$`) and display (`$$...$$`) math expressions using KaTeX, fully offline, no CDN.
Why
Math notation in technical/academic Markdown is unreadable as raw `$` delimiters. KaTeX is the de-facto offline math renderer — fast, no MathJax-style DOM cost.
Proposed approach
- `npm install --save-dev katex` and bundle `katex.min.js` with esbuild into `vendor/`.
- Vendor the KaTeX CSS and fonts (`KaTeX_*.woff2`) into `vendor/katex/`.
- Declare the font files in `web_accessible_resources` of `manifest.json` so the CSS can resolve them via `chrome-extension://...` URLs.
- Either rewrite KaTeX CSS `url(...)` references at build time, or inject a runtime `<style>` block with URLs from `chrome.runtime.getURL()`. Decide based on which keeps the build simpler.
- Integrate as a marked extension that scans for `$` and `$$` delimiters and replaces matches with KaTeX-rendered HTML.
Constraints
- No CDN. Everything bundled locally. Fonts must NOT load from `cdnjs`, `unpkg`, or any external host.
Acceptance criteria
Goal
Render inline (`$...$`) and display (`$$...$$`) math expressions using KaTeX, fully offline, no CDN.
Why
Math notation in technical/academic Markdown is unreadable as raw `$` delimiters. KaTeX is the de-facto offline math renderer — fast, no MathJax-style DOM cost.
Proposed approach
Constraints
Acceptance criteria