Commit 1912016
committed
fix(context-menu): preserve whitespace and selection on paste
Two fixes for context menu paste:
1. Add `preserveWhitespace: true` to `handleHtmlPaste` — Chromium wraps
plain-text clipboard content in HTML, routing it through the HTML paste
path which strips leading/trailing whitespace by default.
2. Use the selection saved at menu-open time (`context.selectionStart/End`)
instead of reading from the live PM state — the right-click handler may
have collapsed a range selection before the paste action runs.1 parent f875666 commit 1912016
2 files changed
Lines changed: 7 additions & 12 deletions
Lines changed: 6 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
300 | 300 | | |
301 | 301 | | |
302 | 302 | | |
303 | | - | |
| 303 | + | |
304 | 304 | | |
305 | 305 | | |
306 | | - | |
307 | | - | |
308 | | - | |
309 | | - | |
310 | | - | |
311 | | - | |
312 | | - | |
313 | | - | |
314 | | - | |
315 | | - | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
316 | 311 | | |
317 | 312 | | |
318 | 313 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
348 | 348 | | |
349 | 349 | | |
350 | 350 | | |
351 | | - | |
| 351 | + | |
352 | 352 | | |
353 | 353 | | |
354 | 354 | | |
| |||
0 commit comments