Phenomenon
When pasting content from a rich text source (such as a word processor or a web page) into a
contenteditable element, the resulting DOM loses headings, lists, or inline formatting that were
present in the source.
Reproduction example
- Copy a short formatted snippet from another application or web page:
- A heading
- A bulleted or numbered list
- A line with bold or italic text
- Focus the editable area.
- Paste the content using the keyboard shortcut or context menu.
Observed behavior
- The pasted content appears as plain text.
- List markers become plain characters, or multiple lines collapse into one.
- Inline styles such as bold or italic are not preserved in the DOM.
Expected behavior
- At least some structural markup (headings, lists, paragraphs) is preserved.
- Inline formatting is preserved or deliberately normalized in a documented way.
Notes
- Compare behavior across browsers and OS combinations using the same source content.
- Decide whether the product should preserve external markup, normalize it to a limited internal model, or always strip it to plain text.