Skip to content

fix(editor): stabilize visual table line breaks - #634

Merged
murongg merged 1 commit into
v2from
fix/visual-table-line-break-webkit
Aug 2, 2026
Merged

fix(editor): stabilize visual table line breaks#634
murongg merged 1 commit into
v2from
fix/visual-table-line-break-webkit

Conversation

@murongg

@murongg murongg commented Aug 2, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • route Enter and Shift+Enter from both visual table cells and Safari’s shared contenteditable table through one controlled path
  • suppress WebKit’s follow-up native line-break event so it cannot rewrite the persisted
    or move the caret back
  • cover line breaks at the start, middle, and end of a cell, Chromium-style cell event targeting, Safari-style table event targeting, and composition input

Why

Safari targets keyboard events at the shared contenteditable table, while Chromium can target the focused cell. The original #632 implementation listened for Enter only on each cell, so Safari fell through to native editing behavior: middle breaks became spaces, boundary breaks could appear briefly, and subsequent input jumped back to the original line.

Validation

  • pnpm --filter @markra/editor test — 34 files, 408 tests passed
  • pnpm --filter @markra/editor test -- table.test.ts — 53 tests passed
  • pnpm --filter @markra/editor build — passed
  • pnpm --filter @markra/editor typecheck:test — passed
  • pnpm --filter @markra/app test -- styles.test.ts MarkdownExportDocument.test.tsx — 72 tests passed
  • Safari QA: generated
    NextAlpha, Al
    Nextpha, and Alpha
    Next for start, middle, and end insertion respectively
  • git diff --check — passed

An initial concurrent full-suite run had one unrelated block-drag test failure; the isolated test and the subsequent serial full suite both passed.

Risk

  • Not run: manual Windows QA; both known browser event-target paths are covered by tests.

Refs #632

Route Enter events from Safari's shared contenteditable table through the same controlled cell path, and suppress duplicate native line-break input.
@vercel

vercel Bot commented Aug 2, 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 2, 2026 12:23am

@murongg
murongg merged commit 7733205 into v2 Aug 2, 2026
21 checks passed
@murongg
murongg deleted the fix/visual-table-line-break-webkit branch August 2, 2026 00:27
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