Commit f5ef92b
committed
fix: paste Excel/spreadsheet copies as text instead of image (#2960)
The image-paste handlers scanned the clipboard for an image file item and
acted on it without checking for co-present text. Excel/Word/spreadsheet
copies place BOTH a rendered bitmap and text/plain on the clipboard, so the
image always won and cells pasted as an uploaded image.
Prefer text when text/plain is present; only treat a paste as an image when
the clipboard is image-only (screenshots, copy-image, Finder file copies have
no text/plain). Fixes the CodeMirror markdown editor and the mdviewer
live-preview paste paths.1 parent d19df7e commit f5ef92b
2 files changed
Lines changed: 18 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
711 | 711 | | |
712 | 712 | | |
713 | 713 | | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
714 | 722 | | |
715 | 723 | | |
716 | 724 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1299 | 1299 | | |
1300 | 1300 | | |
1301 | 1301 | | |
| 1302 | + | |
| 1303 | + | |
| 1304 | + | |
| 1305 | + | |
| 1306 | + | |
| 1307 | + | |
| 1308 | + | |
| 1309 | + | |
| 1310 | + | |
| 1311 | + | |
1302 | 1312 | | |
1303 | 1313 | | |
1304 | 1314 | | |
| |||
0 commit comments