[FIX] Empty message if contains only a link (#787)
* Fix empty message if contains only a link
* 🐛 Fix empty space
This commit is contained in:
parent
013c151c10
commit
d017348dfe
|
@ -57,8 +57,10 @@ const Markdown = React.memo(({
|
||||||
if (m) {
|
if (m) {
|
||||||
m = emojify(m, { output: 'unicode' });
|
m = emojify(m, { output: 'unicode' });
|
||||||
}
|
}
|
||||||
|
const matched = m.match(/^\[([^\]]*)\]\(([^)]*)\)\1/);
|
||||||
|
if (matched && matched[0] !== msg) {
|
||||||
m = m.replace(/^\[([^\]]*)\]\(([^)]*)\)/, '').trim();
|
m = m.replace(/^\[([^\]]*)\]\(([^)]*)\)/, '').trim();
|
||||||
|
}
|
||||||
if (numberOfLines > 0) {
|
if (numberOfLines > 0) {
|
||||||
m = m.replace(/[\n]+/g, '\n').trim();
|
m = m.replace(/[\n]+/g, '\n').trim();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue