You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 20353d5
Browse filesBrowse the repository at this point in the historyBrowse files
fix(composer): paste this app's copied blocks and marks as nodes
Copying a rendered message (or another composer's content) and pasting
it into the composer flattened the parsed document to Markdown source
and inserted it as one text node, so bullet, numbered and nested lists,
bold/italic/strike, inline code, fenced code blocks and blockquotes all
showed as literal `- `, `**`, ```` ``` ```` and `> ` markers in a single
paragraph. The wire Markdown was already right; only the composer view
was wrong.
Split `markdown()` in selection-copy.ts into an exported `copyDocument`
that returns the parsed editor document, and replace `buzzCopyMarkdown`
with `buzzCopyDocument`, which demotes parsed anchors and line breaks to
source text so the host's decorations still decide which links become
chips, as for typed source. The paste handler inserts that document as
a ProseMirror `Slice` in one `closeHistory`'d transaction: a single
paragraph pastes inline, anything else lands as sibling blocks; the
`maxLength` guard, caret placement, undo-as-one-step and
`promoteRecipients` behave as before. Unformatted prose still takes the
text path, inheriting the caret's marks and the message-link spacing.
Unchanged: `text/plain` pastes stay literal (PR #455), the code-block
guard, and external HTML's links-only import (PR #1069). Pasting two
rendered paragraphs mid-sentence now splits the sentence around them
instead of merging into its words.
Tests assert the composer DOM (`ul li`, `ol[start]`, `blockquote`,
`pre`, `strong`) in the timeline → composer and composer → composer
round trips, plus new cases for a list after prose, inline marks
mid-sentence, paragraph splitting, promotion inside pasted blocks, the
code-block guard and the paste limit. `buzzCopyDocument` and
`copyDocument` get node-shape cases; the Chromium journey checks the
pasted blocks before sending.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Signed-off-by: Matt Toohey <[email protected]>
0 commit comments