Case ce-0128-nested-formatting-removal · Scenario scenario-nested-formatting

Removing nested formatting leaves empty or partial elements

OS: Windows 11 Device: Desktop or Laptop Any Browser: Chrome 120.0 Keyboard: US Status: draft
formatting nested removal chrome

Phenomenon

When removing formatting from text that has nested formatting (e.g., <b><i>text</i></b>), empty or partial formatting elements may be left in the DOM. The structure becomes broken.

Reproduction example

  1. Apply bold and italic to text: <b><i>formatted text</i></b>
  2. Remove bold formatting
  3. Observe the DOM structure

Observed behavior

  • Empty <b></b> elements may remain
  • Or partial nesting may remain: <b><i>text</i></b> becomes <i>text</i> but <b> wrapper may remain
  • DOM structure becomes broken
  • Empty elements accumulate

Expected behavior

  • Formatting should be removed cleanly
  • No empty elements should remain
  • Structure should be normalized
  • DOM should be clean

Browser Comparison

  • Chrome/Edge: May leave empty elements (this case)
  • Firefox: More likely to leave empty structures
  • Safari: Most likely to leave broken structures

Notes and possible direction for workarounds

  • Normalize formatting structure after removal
  • Remove empty formatting elements
  • Merge or unwrap nested structures
  • Clean up DOM regularly
Before
Hello World
Nested formatting (bold + italic)
After Removing Bold (Bug)
Hello World
After bold removal, empty &lt;b&gt; element remains
vs
✅ Expected
Hello World
Expected: Empty elements removed, clean nested structure

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-0112-nested-formatting-complex Windows 11 Desktop or Laptop Any Chrome 120.0 US draft
ce-0128-nested-formatting-removal Windows 11 Desktop or Laptop Any Chrome 120.0 US draft
ce-0160-nested-formatting-order-inconsistent Windows 11 Desktop or Laptop Any Safari 17.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.