As designed No way to unlink a hyperlink

Affected version
2.1.6

beerForo

Well-known member
In edit mode, if I highlight and click the paperclip with a line through it, in the editor it is unlinked. But as soon as you save it is lined again. Removing the code in code mode does not work either.
 
Last edited:

Jeremy P

XenForo developer
Staff member
I'm not sure this is a bug as much as it is a consequence of the auto-link behavior. You can wrap an URL in [plain]...[/plain] tags if you would like to work around the auto-link behavior.
 

beerForo

Well-known member
If you highlight the link there is an option to unlink. That would not exist if it would just autolink again anyway.
 

Jeremy P

XenForo developer
Staff member
Are you talking about linked text or a full URL in the message body? The unlink option seems to work as expected for linked text.

Full URLs are automatically converted into links when posts are saved. As such, the unlink option will appear for them if you edit the message, but it will be converted back into a link again when it is saved. I can see why that might seem unexpected, though it can at least be worked around with [plain] tags.
 

beerForo

Well-known member
Type a hyperlink and post.

Click edit, highlight it, and click the unlink button, it is now plain text. Click save, it is a link again.

I see what you are saying but that is not intuitive. If the button is only made to unlink a word and not an actual URL it should not show on URLs. So maybe they can fix that part. Or maybe unlink can add the PLAIN code.

Thanks for your explanation.
 
Last edited:

Chris D

XenForo developer
Staff member
As noted the unlink behaviour doesn’t (and couldn’t) override the auto link behaviour on save.

There are even valid and common use cases where this is the desired behaviour.

If you previously made a link into a URL manually, you may want to remove the link and allow it to be handled on save because that’s when it would auto link the URL into an unfurl or a media embed - a link created in the editor before save would prevent that.

As ever to prevent behaviours like this, we have the PLAIN bb code.
 
Top