From d017348dfec431f33f533a8f65447a60650d8bd3 Mon Sep 17 00:00:00 2001 From: Djorkaeff Alexandre Date: Thu, 27 Jun 2019 14:49:44 -0300 Subject: [PATCH] [FIX] Empty message if contains only a link (#787) * Fix empty message if contains only a link * :bug: Fix empty space --- app/containers/message/Markdown.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/containers/message/Markdown.js b/app/containers/message/Markdown.js index 86fc7d63a..2431d0bec 100644 --- a/app/containers/message/Markdown.js +++ b/app/containers/message/Markdown.js @@ -57,8 +57,10 @@ const Markdown = React.memo(({ if (m) { m = emojify(m, { output: 'unicode' }); } - - m = m.replace(/^\[([^\]]*)\]\(([^)]*)\)/, '').trim(); + const matched = m.match(/^\[([^\]]*)\]\(([^)]*)\)\1/); + if (matched && matched[0] !== msg) { + m = m.replace(/^\[([^\]]*)\]\(([^)]*)\)/, '').trim(); + } if (numberOfLines > 0) { m = m.replace(/[\n]+/g, '\n').trim(); }