Skip to content

Simplify paste handler by delegating to ProseMirror defaults#35

Merged
wandering-logic merged 1 commit into
mainfrom
simplify-paste-handler
Feb 20, 2026
Merged

Simplify paste handler by delegating to ProseMirror defaults#35
wandering-logic merged 1 commit into
mainfrom
simplify-paste-handler

Conversation

@wandering-logic
Copy link
Copy Markdown
Owner

Summary

  • Move slice transformations (table normalization, title→section conversion) to transformPasted where they belong
  • Remove custom block insertion logic that was incorrectly inserting content after the current block instead of at cursor position
  • Let ProseMirror's default handling use slice openStart/openEnd metadata to merge content correctly

Net result: -111 lines of buggy custom logic replaced with ProseMirror's well-tested defaults.

Test plan

  • Paste plain text at cursor within a paragraph - should insert at cursor, not create new paragraph
  • Paste HTML with <h1> tags - should convert to section level 1
  • Paste tables - should normalize to GFM semantics
  • Copy/paste between Reflection Notes windows - should preserve structure

🤖 Generated with Claude Code

Move slice transformations (table normalization, title→section conversion)
to transformPasted where they belong. Remove custom block insertion logic
that was incorrectly inserting content after the current block instead of
at cursor position. ProseMirror's default handling uses slice openStart/
openEnd metadata to merge content correctly.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@wandering-logic wandering-logic merged commit 5361d05 into main Feb 20, 2026
2 checks passed
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