Skip to content

Commit

Permalink
[IMPROVEMENT] Refactor empty space regex on quote (#1017)
Browse files Browse the repository at this point in the history
* 🎨 Improve regex to empty space on quote

* 🎨 Improve on regex to empty space on quote
  • Loading branch information
djorkaeffalexandre authored and diegolmello committed Jun 28, 2019
1 parent fb3d844 commit 7f6767b
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions app/containers/message/Markdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,7 @@ const Markdown = React.memo(({
if (m) {
m = emojify(m, { output: 'unicode' });
}
const matched = m.match(/^\[([^\]]*)\]\(([^)]*)\)\1/);
if (matched && matched[0] !== msg) {
m = m.replace(/^\[([^\]]*)\]\(([^)]*)\)/, '').trim();
}
m = m.replace(/^\[([^\]]*)\]\(([^)]*)\)\s/, '').trim();
if (numberOfLines > 0) {
m = m.replace(/[\n]+/g, '\n').trim();
}
Expand Down

0 comments on commit 7f6767b

Please sign in to comment.