Skip to content

fix(editor): render math in visual table cells - #698

Merged
murongg merged 4 commits into
v2from
fix/issue-697-table-math
Aug 29, 2026
Merged

fix(editor): render math in visual table cells#698
murongg merged 4 commits into
v2from
fix/issue-697-table-math

Conversation

@murongg

@murongg murongg commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • render inline $...$ and \(...\) math inside visual table cells with KaTeX
  • share math range detection between the editor preview and table-cell renderer
  • keep only the active formula as editable Markdown while preserving surrounding text and other rendered formulas
  • support mouse, native button activation, shared-table Enter, Escape, Tab, and Shift+Tab interactions
  • commit the active formula when clicking adjacent text, another formula, another cell, table controls, or outside the table
  • keep escaped dollars, inline code, links, images, and table caret behavior unchanged

Validation

  • pnpm test — 11 workspace projects and 2,692 tests passed
  • pnpm build
  • pnpm typecheck:test
  • local CodeMirror browser QA:
    • physical click revealed formula source and outside click rendered the updated formula
    • Escape restored the original formula
    • Tab committed the formula and moved selection to the next cell
    • Enter and native button click opened formula editing
    • mixed cells retained surrounding text and other rendered formulas
    • switching between two formulas in one cell committed the first and opened the second in one click
    • Preview/Source transitions preserved the updated Markdown

Risk

  • localized to inline math rendering and interaction inside visual table cells
  • stores the active formula as a cell-local source range and refreshes it after input
  • reuses the existing math delimiter rules to avoid parser drift
  • scopes document listeners to the active table session and removes them with the table widget

Closes #697

Reuse the editor math syntax rules for visual table cells while preserving editable Markdown source and existing inline content behavior.

Closes #697
@vercel

vercel Bot commented Aug 27, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
markra-web Ready Ready Preview Aug 27, 2026 12:08pm

Handle formula activation at the visual table widget boundary and preserve the editing session when browsers focus the shared contenteditable table.
Finish the active formula source session on the next pointer press outside its cell, then render the current Markdown and clean up the document listener with the table widget.
Keep only the active formula as editable source, route shared-table Escape and Tab correctly, and support Enter and native button activation without losing surrounding inline rendering.
@murongg
murongg merged commit 60ea1ac into v2 Aug 29, 2026
23 checks passed
@murongg
murongg deleted the fix/issue-697-table-math branch August 29, 2026 00:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Editor]: markdown表格中 Latex格式的公式 不能渲染

1 participant