From cc5d445cdde9988ced6ec180ac03beb3085b72e1 Mon Sep 17 00:00:00 2001 From: Jan Marker Date: Thu, 3 Aug 2017 09:41:12 +0800 Subject: [PATCH] Markdown noopener/noreferrer: use correct HTML attribute Follow-up to #7327 fixing the usage of "ref" to "rel" as pointed out by @pitamar. --- packages/rocketchat-markdown/markdown.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/rocketchat-markdown/markdown.js b/packages/rocketchat-markdown/markdown.js index fd477c6e905..2bcb60d1cd2 100644 --- a/packages/rocketchat-markdown/markdown.js +++ b/packages/rocketchat-markdown/markdown.js @@ -57,7 +57,7 @@ class MarkdownClass { // Support ![alt text](http://image url) msg = msg.replace(new RegExp(`!\\[([^\\]]+)\\]\\(((?:${ schemes }):\\/\\/[^\\)]+)\\)`, 'gm'), function(match, title, url) { const target = url.indexOf(Meteor.absoluteUrl()) === 0 ? '' : '_blank'; - const html = `
`; + const html = `
`; if (message && message.tokens) { const token = `=!=${ Random.id() }=!=`; @@ -76,13 +76,13 @@ class MarkdownClass { // Support [Text](http://link) msg = msg.replace(new RegExp(`\\[([^\\]]+)\\]\\(((?:${ schemes }):\\/\\/[^\\)]+)\\)`, 'gm'), function(match, title, url) { const target = url.indexOf(Meteor.absoluteUrl()) === 0 ? '' : '_blank'; - return `${ _.escapeHTML(title) }`; + return `${ _.escapeHTML(title) }`; }); // Support msg = msg.replace(new RegExp(`(?:<|<)((?:${ schemes }):\\/\\/[^\\|]+)\\|(.+?)(?=>|>)(?:>|>)`, 'gm'), (match, url, title) => { const target = url.indexOf(Meteor.absoluteUrl()) === 0 ? '' : '_blank'; - return `${ _.escapeHTML(title) }`; + return `${ _.escapeHTML(title) }`; }); if (typeof window !== 'undefined' && window !== null ? window.rocketDebug : undefined) { console.log('Markdown', msg); }