Trailing whitespaces are removed when pasting text in Firefox
OS: Windows 10-11 · Device: Desktop or Laptop Any · Browser: Firefox 120+ · Keyboard: US QWERTY
Open case →Scenario
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.
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.
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-0302-firefox-trailing-whitespace-paste-en | Windows 10-11 | Desktop or Laptop Any | Firefox 120+ | US QWERTY | draft |
Open a case to see the detailed description and its dedicated playground.
OS: Windows 10-11 · Device: Desktop or Laptop Any · Browser: Firefox 120+ · Keyboard: US QWERTY
Open case →Other scenarios that share similar tags or category.
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.
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.
Legacy IE11 and enterprise paste pipelines could embed images as large base64 data URIs in contenteditable HTML—performance and security implications for sanitizers.
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.
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.
Have questions, suggestions, or want to share your experience? Join the discussion below.