Phenomenon
When pasting content from external sources (like Word documents or web pages) into a contenteditable region, unwanted formatting is often included. There is no simple way to paste as plain text without manually stripping the formatting.
Reproduction example
- Copy formatted text from a Word document or web page (with bold, colors, fonts, etc.).
- Paste it into a contenteditable div.
- Observe that all the formatting is included.
Observed behavior
- Safari pastes rich text with all formatting by default.
- There is no built-in “Paste as plain text” option.
- Manual intervention is required to strip formatting.
Expected behavior
- There should be a way to paste as plain text (e.g., Cmd+Shift+V or a context menu option).
- The paste behavior should be controllable by the application.
- The
beforeinputevent should allow intercepting and modifying paste operations.