diff --git a/server/modules/rendering/html-core/definition.yml b/server/modules/rendering/html-core/definition.yml index f8f5f3f0..c11da260 100644 --- a/server/modules/rendering/html-core/definition.yml +++ b/server/modules/rendering/html-core/definition.yml @@ -12,3 +12,9 @@ props: title: Treat relative links as root absolute hint: For example, a link to foo/bar on page xyz will render as /foo/bar instead of /xyz/foo/bar. order: 1 + openExternalLinkNewTab: + type: Boolean + default: false + title: Open external links in a new tab + hint: External links will have a _blank target attribute added automatically. + order: 2 diff --git a/server/modules/rendering/html-core/renderer.js b/server/modules/rendering/html-core/renderer.js index d0ce78d8..98f4562e 100644 --- a/server/modules/rendering/html-core/renderer.js +++ b/server/modules/rendering/html-core/renderer.js @@ -113,7 +113,9 @@ module.exports = { } } else { $(elm).addClass(`is-external-link`) - $(elm).attr('target', '_blank') + if (this.config.openExternalLinkNewTab) { + $(elm).attr('target', '_blank') + } } // -> Update element