Skip to content

feat: improve copy-paste behavior#301

Merged
ocavue merged 17 commits into
masterfrom
clipboard-refactor
Jul 12, 2026
Merged

feat: improve copy-paste behavior#301
ocavue merged 17 commits into
masterfrom
clipboard-refactor

Conversation

@ocavue

@ocavue ocavue commented Jul 12, 2026

Copy link
Copy Markdown
Member

Copying now writes standard semantic HTML (real <h3> / <ol><li> / <strong>) with the markdown source preserved in data-md attributes, plus a markdown-shaped text/plain whose inline layer follows the mark mode (hide strips the syntax characters, focus and show keep the full source). Pasting routes by signature: meowdown's own clipboard HTML parses natively and byte-exact, foreign HTML (including other ProseMirror editors) converts through markdown, and plain text follows markdown newline semantics (aaa\n\nbbb no longer inserts an empty paragraph) while Shift-paste keeps ProseMirror's default line splitting. The whole pipeline now ships inside defineEditorExtension, replacing defineMarkdownCopy and the react-level defineHTMLPaste wiring.

@vercel

vercel Bot commented Jul 12, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
meowdown Ready Ready Preview Jul 12, 2026 3:56pm

@pkg-pr-new

pkg-pr-new Bot commented Jul 12, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/prosekit/meowdown/@meowdown/core@301
npm i https://pkg.pr.new/prosekit/meowdown/@meowdown/react@301

commit: 6afb2cd

@github-actions

github-actions Bot commented Jul 12, 2026

Copy link
Copy Markdown

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 94.24% 3780 / 4011
🔵 Statements 91.83% 4209 / 4583
🔵 Functions 92.51% 927 / 1002
🔵 Branches 86.1% 2571 / 2986
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/core/src/index.ts 0% 0% 0% 0%
packages/core/src/extensions/code-block.ts 100% 93.33% 100% 100%
packages/core/src/extensions/extension.ts 100% 100% 100% 100%
packages/core/src/extensions/heading.ts 100% 100% 100% 100%
packages/core/src/extensions/html-paste.ts 100% 100% 100% 100%
packages/core/src/extensions/mark-mode.ts 100% 94.44% 100% 100%
packages/core/src/extensions/paragraph.ts 100% 100% 100% 100%
packages/core/src/extensions/clipboard/clipboard-parser.ts 100% 100% 100% 100%
packages/core/src/extensions/clipboard/clipboard-serializer.ts 100% 50% 100% 100%
packages/core/src/extensions/clipboard/clipboard.ts 100% 100% 100% 100%
packages/core/src/extensions/clipboard/plain-paste.ts 100% 80% 100% 100%
packages/core/src/extensions/clipboard/plain-text.ts 93.93% 80% 100% 96.66% 25, 27
packages/core/src/extensions/clipboard/semantic-inline.ts 89.15% 76.78% 100% 92.85% 59, 170, 171, 172, 180-184
packages/core/src/utils/parse-integer.ts 100% 87.5% 100% 100%
packages/react/src/components/editor-extensions.tsx 100% 97.22% 100% 100%
Generated in workflow #1214 for commit 6afb2cd by the Vitest Coverage Report Action

@ocavue ocavue changed the title feat: semantic clipboard HTML with data-md round trip and markdown-shaped plain text feat: improve copy-paste behavior Jul 12, 2026
@ocavue ocavue marked this pull request as ready for review July 12, 2026 15:56
@ocavue ocavue merged commit f36870e into master Jul 12, 2026
10 checks passed
@ocavue ocavue deleted the clipboard-refactor branch July 12, 2026 16:01
@ocavuebot ocavuebot mentioned this pull request Jul 12, 2026
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