Pasting rich text inserts unwanted formatting
OS: macOS Ubuntu 22.04 · Device: Desktop or Laptop Any · Browser: Safari 120.0
Open case →Scenario
Rich paste into contenteditable pulls in unwanted HTML; users expect paste-as-plain-text or plaintext-only modes. Browsers differ on clipboard APIs, execCommand, and how NBSP and whitespace survive—breaking layout when editors assume 'plain' means U+0020 only.
Rich paste into contenteditable pulls in unwanted HTML; users expect paste-as-plain-text or plaintext-only modes. Browsers differ on clipboard APIs, execCommand, and how NBSP and whitespace survive—breaking layout when editors assume “plain” means U+0020 only.
contenteditable="plaintext-only" (where supported) reduces rich paste but has compatibility limits; manual stripping via clipboardData.getData('text/plain') must still normalize spaces.
plaintext-only + NBSP: line layout can break (see related cases).Unexpected bold/color in “simple” fields; subtle layout bugs from non-breaking spaces.
Visual view of how this scenario connects to its concrete cases and environments. Nodes can be dragged and clicked.
Each row is a concrete case for this scenario, with a dedicated document and playground.
| Case | OS | Device | Browser | Keyboard | Status |
|---|---|---|---|---|---|
| ce-0019-paste-plain-text-only | macOS Ubuntu 22.04 | Desktop or Laptop Any | Safari 120.0 | US | draft |
| ce-0572 | Linux Ubuntu 22.04 | Desktop Any | Chrome 121.0 | US QWERTY | confirmed |
This matrix shows which browser and OS combinations have documented cases for this scenario. Click on a cell to view the specific case.
| Browser | Linux | macOS |
|---|---|---|
| Chrome | ce-0572 121.0 | — |
| Safari | — |
This scenario affects multiple languages. Cases are grouped by language/input method below.
OS: macOS Ubuntu 22.04 · Device: Desktop or Laptop Any · Browser: Safari 120.0
Open case →OS: Linux Ubuntu 22.04 · Device: Desktop Any · Browser: Chrome 121.0
Open case →Other scenarios that share similar tags or category.
Edge on Linux (Chromium-based) can differ from Windows Edge for clipboard MIME types, file paste, and integration with Wayland clipboard—paste into contenteditable may drop images or format differently.
The same paste pipeline may keep bold from Google Docs but strip it from Notion, or preserve inline styles in Chrome but normalize differently in Safari—clipboard HTML and browser sanitizers vary.
Leading spaces and tabs in pasted code can collapse to a single space or be stripped when the editor normalizes to paragraphs or applies pre-wrap inconsistently.
Legacy IE11 and enterprise paste pipelines could embed images as large base64 data URIs in contenteditable HTML—performance and security implications for sanitizers.
Firefox and other browsers may preserve or normalize trailing newlines and spaces differently when pasting plain text—collaborative editors and diffs see unexpected whitespace changes.
Have questions, suggestions, or want to share your experience? Join the discussion below.