Scenario

Code block indentation lost on paste or format

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.

clipboard
Scenario ID
scenario-code-block-indentation-lost

Details

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.

References

Scenario flow

Visual view of how this scenario connects to its concrete cases and environments. Nodes can be dragged and clicked.

React Flow mini map

Variants

Each row is a concrete case for this scenario, with a dedicated document and playground.

Case OS Device Browser Keyboard Status
ce-0170-code-block-indentation-lost Any Any Desktop or Laptop Any Chrome Latest US draft

Cases

Open a case to see the detailed description and its dedicated playground.

Related Scenarios

Other scenarios that share similar tags or category.

Tags: paste, whitespace

Trailing and leading whitespace on paste

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.

1 case
Tags: paste

Clipboard and paste behavior in Edge on Linux

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.

1 case
Tags: paste

Plain text paste and plaintext-only contenteditable

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.

2 cases

Comments & Discussion

Have questions, suggestions, or want to share your experience? Join the discussion below.