diff --git a/lib/shared/addon/helpers/linkify.js b/lib/shared/addon/helpers/linkify.js index bb3ec7ae62..871731df0c 100644 --- a/lib/shared/addon/helpers/linkify.js +++ b/lib/shared/addon/helpers/linkify.js @@ -1,7 +1,7 @@ import { helper } from '@ember/component/helper'; import { htmlSafe } from '@ember/string'; import Ember from 'ember'; -import linkifyStr from 'linkifyjs/string'; +import linkifyStr from 'linkify-string'; const MAX_LENGTH = 1000; @@ -15,7 +15,10 @@ export function linkify(params) { content = Ember.Handlebars.Utils.escapeExpression(content); content = linkifyStr(content, { - attributes: { rel: 'nofollow noreferrer' }, + attributes: { + rel: 'nofollow noreferrer', + target: '_blank', + }, defaultProtocol: 'https' }); diff --git a/lib/shared/app/helpers/linkify.js b/lib/shared/app/helpers/linkify.js index 686d44277f..0f9d640a6e 100644 --- a/lib/shared/app/helpers/linkify.js +++ b/lib/shared/app/helpers/linkify.js @@ -1,3 +1,3 @@ // https://github.com/ef4/ember-browserify#the-workaround -import linkifyStr from 'linkifyjs/string'; // eslint-disable-line no-unused-vars +import linkifyStr from 'linkify-string'; // eslint-disable-line no-unused-vars export { default } from 'shared/helpers/linkify'; diff --git a/package.json b/package.json index d0b4e75e72..9a5fc87462 100644 --- a/package.json +++ b/package.json @@ -91,7 +91,8 @@ "json2yaml": "^1.1.0", "jsondiffpatch": "^0.4.1", "jszip": "^3.1.5", - "linkifyjs": "^2.1.9", + "linkifyjs": "^4.1.3", + "linkify-string": "^4.1.3", "loader.js": "^4.7.0", "marked": "^2.0.0", "moment": "~2.29.0", diff --git a/yarn.lock b/yarn.lock index de487eaa3d..e86824df1b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5384,9 +5384,9 @@ caniuse-api@^3.0.0: lodash.uniq "^4.5.0" caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001219: - version "1.0.30001439" - resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001439.tgz" - integrity sha512-1MgUzEkoMO6gKfXflStpYgZDlFM7M/ck/bgfVCACO5vnAf0fXoNVHdWtqGU+MYca+4bL9Z5bpOVmR33cWW9G2A== + version "1.0.30001565" + resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001565.tgz" + integrity sha512-xrE//a3O7TP0vaJ8ikzkD2c2NgcVUvsEe2IvFTntV4Yd1Z9FVzh+gW+enX96L0psrbaFMcVcH2l90xNuGDWc8w== capture-exit@^2.0.0: version "2.0.0" @@ -10463,10 +10463,15 @@ linkify-it@^3.0.1: dependencies: uc.micro "^1.0.1" -linkifyjs@^2.1.9: - version "2.1.9" - resolved "https://registry.yarnpkg.com/linkifyjs/-/linkifyjs-2.1.9.tgz#af06e45a2866ff06c4766582590d098a4d584702" - integrity sha512-74ivurkK6WHvHFozVaGtQWV38FzBwSTGNmJolEgFp7QgR2bl6ArUWlvT4GcHKbPe1z3nWYi+VUdDZk16zDOVug== +linkify-string@^4.1.3: + version "4.1.3" + resolved "https://registry.yarnpkg.com/linkify-string/-/linkify-string-4.1.3.tgz#a47dbbf64c9fbd2f6ae5e26cd41ec2e5748a54d1" + integrity sha512-6dAgx4MiTcvEX87OS5aNpAioO7cSELUXp61k7azOvMYOLSmREx0w4yM1Uf0+O3JLC08YdkUyZhAX+YkasRt/mw== + +linkifyjs@^4.1.3: + version "4.1.3" + resolved "https://registry.yarnpkg.com/linkifyjs/-/linkifyjs-4.1.3.tgz#0edbc346428a7390a23ea2e5939f76112c9ae07f" + integrity sha512-auMesunaJ8yfkHvK4gfg1K0SaKX/6Wn9g2Aac/NwX+l5VdmFZzo/hdPGxEOETj+ryRa4/fiOPjeeKURSAJx1sg== livereload-js@^3.3.1: version "3.3.2"