Case ce-0112-nested-formatting-complex · Scenario scenario-nested-formatting

Applying multiple formatting creates deeply nested structures

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

Phenomenon

When applying multiple formatting operations (bold, italic, underline) to text, deeply nested HTML structures are created (e.g., <b><i><u>text</u></i></b>). This makes the DOM complex and hard to manage.

Reproduction example

  1. Select some text
  2. Apply bold formatting
  3. Apply italic formatting
  4. Apply underline formatting
  5. Observe the DOM structure

Observed behavior

  • Deeply nested structure: <b><i><u>text</u></i></b>
  • Or different nesting order depending on application sequence
  • DOM becomes complex and bloated
  • Difficult to manage formatting state

Expected behavior

  • Formatting should be applied efficiently
  • Nesting should be minimized where possible
  • Structure should be normalized
  • Formatting state should be easy to query

Browser Comparison

  • Chrome/Edge: Creates nested structures (this case)
  • Firefox: Similar nesting behavior
  • Safari: Most complex nesting

Notes and possible direction for workarounds

  • Normalize formatting structure after operations
  • Merge same-type formatting elements
  • Use consistent nesting order
  • Consider using data attributes instead of nested elements
Before
Text
Basic text
After Bold
Text
Bold formatting applied
vs
✅ Expected (Normalized)
Text
Expected: Consolidated into style attribute, nesting minimized

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.