Add icon to links that open in a new window #2175

Closed
opened 2026-02-05 03:12:19 +03:00 by OVERLORD · 1 comment
Owner

Originally created by @frank-embleton on GitHub (Mar 25, 2021).

Describe the feature you'd like
Links that open in a new window should have an icon as hint to the user.
Example:
image

Describe the benefits this feature would bring to BookStack users
This is common behaviour elsewhere online. The most obvious example I can think of is Wikipedia, where all external links have an icon after them
Reference implementation:
image

Additional context
I have successfully implemented it by adding the following snippet in the Custom HTML Head Content on the Settings page. I feel that it would be a useful default.

a[target=_blank][href*="//"]:not([href*="mysite.com"]):after {
    content: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAQElEQVR42qXKwQkAIAxDUUdxtO6/RBQkQZvSi8I/pL4BoGw/XPkh4XigPmsUgh0626AjRsgxHTkUThsG2T/sIlzdTsp52kSS1wAAAABJRU5ErkJggg==);
margin: 0 3px 0 5px;
}

Originally created by @frank-embleton on GitHub (Mar 25, 2021). **Describe the feature you'd like** Links that open in a new window should have an icon as hint to the user. _Example:_ ![image](https://user-images.githubusercontent.com/61879399/112459404-15603180-8d5e-11eb-853f-347e230b1f6c.png) **Describe the benefits this feature would bring to BookStack users** This is common behaviour elsewhere online. The most obvious example I can think of is Wikipedia, where all external links have an icon after them _Reference implementation:_ ![image](https://user-images.githubusercontent.com/61879399/112459023-ad115000-8d5d-11eb-8b8e-2c71d6ff9a64.png) **Additional context** I have successfully implemented it by adding the following snippet in the Custom HTML Head Content on the Settings page. I feel that it would be a useful default. ``` a[target=_blank][href*="//"]:not([href*="mysite.com"]):after { content: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAQElEQVR42qXKwQkAIAxDUUdxtO6/RBQkQZvSi8I/pL4BoGw/XPkh4XigPmsUgh0626AjRsgxHTkUThsG2T/sIlzdTsp52kSS1wAAAABJRU5ErkJggg==); margin: 0 3px 0 5px; } ```
OVERLORD added the :cat2:🐈 Possible duplicate label 2026-02-05 03:12:19 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Mar 26, 2021):

Thanks for the request @frank-embleton.

The fundamental request has already been requested as part of #1620 so I'll therefore close this off as a duplicate.

@ssddanbrown commented on GitHub (Mar 26, 2021): Thanks for the request @frank-embleton. The fundamental request has already been requested as part of #1620 so I'll therefore close this off as a duplicate.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#2175