Trim trailing newlines from outgoing messages
This commit is contained in:
parent
fef8c5b2f1
commit
98da8746e8
2 changed files with 13 additions and 3 deletions
|
@ -57,7 +57,8 @@ export const getTextFromOps = (ops: Array<DeltaOperation>): string =>
|
|||
break;
|
||||
}
|
||||
}
|
||||
return acc + textToAdd;
|
||||
const textWithoutNewlines = textToAdd.replace(/\n+$/, '');
|
||||
return acc + textWithoutNewlines;
|
||||
}
|
||||
|
||||
if (insert.emoji) {
|
||||
|
@ -93,7 +94,9 @@ export const getTextAndMentionsFromOps = (
|
|||
break;
|
||||
}
|
||||
}
|
||||
return acc + textToAdd;
|
||||
|
||||
const textWithoutNewlines = textToAdd.replace(/\n+$/, '');
|
||||
return acc + textWithoutNewlines;
|
||||
}
|
||||
|
||||
if (isInsertEmojiOp(op)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue