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
- create a link in the text
- Remove the link
- Color and underline remain active in text and underline toolbar button remains active
SuperDoc version
No response
Browser
None
Additional context
No response
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
SuperDoc version
No response
Browser
None
Additional context
No response