diff --git a/scripts/core/editor3/components/links/LinkInput.tsx b/scripts/core/editor3/components/links/LinkInput.tsx index db917d6477..f0dd79bda3 100644 --- a/scripts/core/editor3/components/links/LinkInput.tsx +++ b/scripts/core/editor3/components/links/LinkInput.tsx @@ -9,6 +9,7 @@ import {applyLink, hidePopups, createLinkSuggestion, changeLinkSuggestion} from import {connectPromiseResults} from 'core/helpers/ReactRenderAsync'; import ng from 'core/services/ng'; import {gettext} from 'core/utils'; +import {appConfig} from 'appConfig'; /** * @ngdoc React @@ -93,7 +94,7 @@ export class LinkInputComponent extends React.Component { const isLocalDomain = (localDomains || []).some((item) => url.includes(item.domain)); link = {href: url}; - if (!isLocalDomain && localDomains != null) { + if ((appConfig.linksBlankTarget === true) || (!isLocalDomain && localDomains != null)) { link.target = '_blank'; } } else if (linkType === linkTypes.attachement) { diff --git a/scripts/core/superdesk-api.d.ts b/scripts/core/superdesk-api.d.ts index 49dd783052..fc15a42dbe 100644 --- a/scripts/core/superdesk-api.d.ts +++ b/scripts/core/superdesk-api.d.ts @@ -1963,6 +1963,9 @@ declare module 'superdesk-api' { oidc_auth: any; keycloak_config: any; + /** Allow default target for links to be _blank. */ + linksBlankTarget?: boolean; + /** * Enable autocomplete for supported text fields in authoring. * Values of published items are used for autocomplete suggestions.