* fix(web): keep statistics notation as inline math
plausibleMathBody judged inline math by Latin words, so $Var(N)$, $Cov(X,Y)
and $Corr(X,Y)$ fell through escapeStrayDollars and displayed as source.
Add the common statistics functions to MATH_WORDS.
Also recover control characters left by JSON tool-argument decoding
(U+0008/U+000C/U+000D followed by a letter) back into \b, \f and \r, so
formulas already stored in notes render again.
Tests: latex-normalize.test.ts.
Co-Authored-By: Claude Code <noreply@anthropic.com>
* fix(web): only restore a decoded escape that spells a KaTeX command
A form feed or carriage return in front of a word is not always a mangled
\frac or \right: text extracted from a PDF keeps a form feed between pages.
Rewriting every one of them showed a stray "\f" in front of the next word.
Restore the backslash only when the letters after it name a KaTeX command.
---------
Co-authored-by: Claude Code <noreply@anthropic.com>
Co-authored-by: zszz3 <91608029+zszz3@users.noreply.github.com>
* fix: parse inline math in note tables and statistics notation
BlockNote only renders `inlineMath` nodes, and two common shapes never
became one:
- `parseNoteMarkdown` converted inline `$...$` in a block's top-level
content, but table cells live under `tableContent.rows`, which the walk
never reached.
- The normaliser treated `$Var(N)$` and `$Cov(X, Y)$` as prose because the
Latin-word heuristic did not recognise statistics function names, so it
escaped the delimiters as stray dollars.
Recurse into `tableContent` cells and add the common statistics function
names to the math-word allowlist, with regression tests for both.
Co-Authored-By: Claude Code <noreply@anthropic.com>
* fix(web): count statistics names as maths only when they are called
"mean", "median", "rank", "span" and "var" are English words and a
keyword too, so with them in the word list "$52k mean, $48k median" became a
formula and a backticked `var x = 1` on a page with maths turned into KaTeX.
Keep them out of MATH_WORDS and accept them only before "(", which is how
Var(X) and Cov(X, Y) are written.
---------
Co-authored-by: Claude Code <noreply@anthropic.com>
Co-authored-by: zszz3 <91608029+zszz3@users.noreply.github.com>
* fix: render bare scripted math in quiz prose
* fix(web): recover quiz subscripts parsed as emphasis
Adjacent bare formulas can share Markdown emphasis delimiters. Mask candidate underscores only while locating prose ranges, then wrap the original symbols for KaTeX. Cover the reported circuit options through all three rendering routes.
A formula closed with a space before the dollar (`$\lim a_n = $ ____`, the
usual shape of a fill-in-the-blank question) is no MATH_SPAN_RE match, so
the bare-LaTeX pass wrapped its body again and produced `$$\lim a_n =$ $`:
a display block that never closes, with the rest of the text raw.
Pairing the dollars before that pass tightens it first; the final pass
still runs as before.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mapMarkdownProse closed a fenced code block at any later line whose fence
marker matched, including lines that carry an info string (```tex inside a
```text block). Per CommonMark a closing fence has no info string, so such a
line is code content, not a close. Closing early let the block's remaining
content run through prose normalization — e.g. a documented \(x+y\) example
became $x+y$ — which is exactly what this helper exists to prevent.
Require an empty info string before treating a line as a closing fence,
matching the sibling fence trackers in reading-outline.ts and
think-segments.ts.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Ship folder-based workspaces and data migration, daily practice, redesigned
provider and model settings, and streaming conversation improvements.
Synchronize README translations and document the archive/permanent-delete
upgrade behavior in assets/releases/ver1-6-9.md.
Reduce initial JavaScript by deduplicating English resources and loading
animation features after hydration. Keep the existing route size budgets.
Update regression fixtures and browser audits for scoped URLs and the new
settings and learning interfaces.