Skip to content

fix(core): convert typed markdown tables - #2

Open
manuaudio wants to merge 1 commit into
usememos:mainfrom
manuaudio:fix/typed-markdown-tables
Open

manuaudio wants to merge 1 commit into
usememos:mainfrom
manuaudio:fix/typed-markdown-tables

Conversation

@manuaudio

Copy link
Copy Markdown

Typing a GFM table in rich mode currently leaves the header and delimiter in a paragraph. The paragraph serializer then escapes the delimiter's first dash to preserve the paragraph model, so the saved Markdown no longer parses as a table.

This change recognizes a complete typed table after the first full-width body row is finished. It reuses the existing Markdown parser and row splitter, converts the paragraph to the parsed table model, and keeps the caret at the end of the last typed cell. Waiting for the body row avoids converting while the user is still typing the delimiter, and the raw row-width check prevents short rows from triggering the shortcut early.

The command tests cover conversion, caret placement, incomplete input, delimiter-only input, header-plus-delimiter input, and width mismatch. The browser regression types the sequence reported in usememos/memos#6480 and verifies that the saved Markdown is a valid table without an escaped delimiter.

Verified with:

  • npm test (10,125 passed; 59 todo)
  • npm run typecheck
  • Chromium Playwright regression
  • git diff --check

@coderabbitai

coderabbitai Bot commented Nov 1, 2026

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e4ff26d1-b855-45ce-afc0-7ffe72f78acb
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

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.

1 participant