Skip to content

Unsetting link leaves transient hyperlink styleId and keeps underline tool active #3189

@christos8333

Description

@christos8333

What happened?

When removing a link (unsetLink()), the editor can leave transient hyperlink style metadata behind, causing formatting to appear still active after unlink.

Problem
After unlinking text, hyperlink-derived formatting (underline/color in content and underline tool active in toolbar) may remain active even though the link mark is removed.

Root Cause
unsetLink() removed the link mark, but transient hyperlink style IDs could remain in document state:

textStyle.attrs.styleId
run.attrs.runProperties.styleId
Affected transient IDs:

Hyperlink
FollowedHyperlink
Because style resolution still sees these IDs, hyperlink formatting can persist.

Expected Behavior
Unlink should remove link-derived transient hyperlink style references while preserving non-link character styles

Steps to reproduce

  1. create a link in the text
  2. Remove the link
  3. Color and underline remain active in text and underline toolbar button remains active

SuperDoc version

No response

Browser

None

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions