diff --git a/public/docs/release-notes.md b/public/docs/release-notes.md index 1db7d3d8..02f2956e 100644 --- a/public/docs/release-notes.md +++ b/public/docs/release-notes.md @@ -6,6 +6,7 @@ - Added external link whitelist setting (`externalLinkWhitelist` in config.json or `CMD_EXTERNAL_LINK_WHITELIST`) to skip warning page for certain domains - Added external link warning setting (`externalLinkWarning` in config.json or `CMD_EXTERNAL_LINK_WARNING`) to disable the external link warning page entirely +- Fixed external link warning for subpath instances - Enabled `.webp` for file uploads (for all backends but `imgur`, since it does not support it) ### Bugfixes diff --git a/public/js/extra.js b/public/js/extra.js index 957cca2a..6ab1cfaa 100644 --- a/public/js/extra.js +++ b/public/js/extra.js @@ -624,7 +624,8 @@ export function rewriteExternalLinks (view) { return } const noteURL = window.location.pathname.split('/').pop() - anchor.attr('href', `${window.location.origin}/_link?url=${encodeURIComponent(parsed.href)}¬e=${noteURL}`) + const urlPath = window.urlpath ? `/${window.urlpath}` : '' + anchor.attr('href', `${window.location.origin}${urlPath}/_link?url=${encodeURIComponent(parsed.href)}¬e=${noteURL}`) }) } window.rewriteExternalLinks = rewriteExternalLinks