Files
DeepTutor/web
lytanjie 305eb7bf75 fix: parse inline math in note tables and statistics notation (#2737)
* 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>
2026-11-29 15:11:07 +08:00
..
…