Pasting a thread with images keeps the text and skips the blank thumbnails - #77292
Merged
Conversation
Copying a Discord thread (or any rich-text selection with images) attached one or more blank thumbnails and dropped the message text entirely. Two causes. The clipboard's `text/html` was scraped for inline `<img src="data:…">` regardless of whether the copy carried its own text — and what Discord ships beside each image embed is a 32x5 blurhash placeholder, which is exactly the blank attachment. Then, because any image blob short-circuited the paste handler, the prose that came with it never reached the composer. Inline HTML images now only count for an image-only copy, and are ignored below a thumbnail-sized floor so spacers and trackers don't attach either. A mixed paste attaches its real images and still inserts its text. Also registers pasteAndMatchStyle in the Edit menu — Cmd+Shift+V had no menu entry, so the chord was never translated into an editor command anywhere in the app.
OutThisLife
enabled auto-merge
August 3, 2026 03:29
Contributor
૮ >ﻌ< ა ci reviewran on 9e373b3 all good! |
randlee
pushed a commit
to randlee/hermes-agent
that referenced
this pull request
Aug 11, 2026
…ixed-paste Pasting a thread with images keeps the text and skips the blank thumbnails
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Copying a Discord thread — text that happens to have image embeds in it — attached a couple of blank thumbnails to the composer and lost the message text. Verified against the real clipboard: the HTML Discord writes carries a 32×5 PNG blurhash placeholder beside each embed, and that placeholder was what got attached.
The inline-
<img src="data:…">scrape ran on every paste, including a rich-text copy that had 335 characters of its own text. Any blob it found then short-circuited the handler, so the prose never reached the editor. Inline HTML images now only count when the copy is image-only, and only above a thumbnail-sized floor so spacers, trackers, and blurhash stand-ins are left alone. A paste that genuinely carries both attaches its images and inserts its text.pasteAndMatchStylealso joins the Edit menu: ⌘⇧V had an accelerator with no menu entry, which Electron never translates into an editor command, so the chord did nothing anywhere in the app.