Case ce-0132-html-entities-copy · Scenario scenario-html-entity-encoding

HTML entities are encoded inconsistently when copying

OS: Windows 11 Device: Desktop or Laptop Any Browser: Chrome 120.0 Keyboard: US Status: draft
html entity encoding copy chrome

Phenomenon

When copying content that contains special characters from a contenteditable element, the characters may be encoded as HTML entities or copied as actual characters inconsistently. This causes issues when pasting elsewhere.

Reproduction example

  1. Create content with special characters: <div>Test</div>
  2. Select and copy the content
  3. Check clipboard data

Observed behavior

  • Characters may be encoded: &lt;div&gt;Test&lt;/div&gt;
  • Or characters may be copied as-is: <div>Test</div>
  • Behavior is inconsistent
  • Pasting elsewhere may show different results

Expected behavior

  • Entity encoding should be consistent
  • Or behavior should be predictable
  • Special characters should be preserved correctly
  • Copy/paste should work reliably

Browser Comparison

  • Chrome/Edge: Entity encoding inconsistent (this case)
  • Firefox: Similar inconsistent behavior
  • Safari: Entity handling varies

Notes and possible direction for workarounds

  • Normalize entity encoding before copy
  • Use Clipboard API to control encoding
  • Handle special characters explicitly
  • Document expected copy behavior
Before
Test
Content with special characters
Clipboard (Bug - Encoded)
<div>Test</div>
When copying, encoded as HTML entities
vs
✅ Expected
Test
Expected: Consistent encoding handling

Browser compatibility matrix

This matrix shows which browser and OS combinations have documented cases for this scenario. The current case is highlighted. Click on a cell to view other cases.

Current case
Confirmed
Draft
No case documented

All variants (detailed table)

Complete list of all cases for this scenario with full environment details.

Case OS Device Browser Keyboard Status
ce-0123-html-entities-paste Windows 11 Desktop or Laptop Any Chrome 120.0 US draft
ce-0132-html-entities-copy Windows 11 Desktop or Laptop Any Chrome 120.0 US draft
ce-0162-html-entities-serialization Windows 11 Desktop or Laptop Any Chrome 120.0 US draft

Playground for this case

Use the reported environment as a reference and record what happens in your environment while interacting with the editable area.

Reported environment
OS: Windows 11
Device: Desktop or Laptop Any
Browser: Chrome 120.0
Keyboard: US
Your environment
Sample HTML:
Event log
Use this log together with the case description when filing or updating an issue.
0 events
Interact with the editable area to see events here.

Comments & Discussion

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