Case ce-0133-link-removal-leaves-empty · Scenario scenario-link-insertion

Removing link leaves empty anchor tags in Firefox

OS: Windows 11 Device: Desktop or Laptop Any Browser: Firefox 120.0 Keyboard: US Status: draft
link anchor empty firefox

Phenomenon

When removing a link (keeping the text) in Firefox, empty anchor tags may be left in the DOM. These empty <a> elements cause layout issues and bloat the HTML.

Reproduction example

  1. Create a link: <a href="url">Link text</a>
  2. Remove the link (unlink operation)
  3. Observe the DOM

Observed behavior

  • Empty <a></a> tags may remain
  • Or <a> tags with only whitespace remain
  • DOM becomes bloated
  • Layout may have unexpected spacing

Expected behavior

  • Link should be removed cleanly
  • Text should remain without link wrapper
  • No empty anchor tags should remain
  • DOM should be clean

Browser Comparison

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

Notes and possible direction for workarounds

  • Intercept link removal
  • Clean up empty anchor tags
  • Unwrap link and preserve text content
  • Normalize DOM after link operations
Before
Link element
After Unlink (Bug)
Link text
After link removal, empty anchor tag remains
vs
✅ Expected
Link text
Expected: After link removal, only text remains, no empty tags

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-0100-link-insertion-chrome Windows 11 Desktop or Laptop Any Chrome 120.0 US draft
ce-0133-link-removal-leaves-empty Windows 11 Desktop or Laptop Any Firefox 120.0 US draft
ce-0152-link-href-update-difficult 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: Firefox 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.