Skip to content

Commit d009e18

Browse files
authored
Merge pull request #599 from Gjum/patch-1
don't trim chat message parts
2 parents 8a3e0da + 7412083 commit d009e18

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/chat_message.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ class ChatMessage {
197197
// If the index is not defined is is invalid, return toString
198198
if (typeof idx !== 'number') return this.toString(lang)
199199
// If we are not a translating message, return the text
200-
if (this.text && idx === 0) return this.text.replace(/§[0-9a-flnmokr]/g, '').trim()
200+
if (this.text && idx === 0) return this.text.replace(/§[0-9a-flnmokr]/g, '')
201201
// Else return the with child if it's in range
202202
else if (this.with.length > idx) return this.with[idx].toString(lang)
203203
// Else return the extra if it's in range
@@ -225,7 +225,7 @@ class ChatMessage {
225225
if (this.extra) {
226226
message += this.extra.map((entry) => entry.toString(lang)).join('')
227227
}
228-
return message.replace(/§[0-9a-flnmokr]/g, '').trim()
228+
return message.replace(/§[0-9a-flnmokr]/g, '')
229229
}
230230

231231
toMotd (lang = defaultLang) {
@@ -271,7 +271,7 @@ class ChatMessage {
271271
if (this.extra) {
272272
message += this.extra.map((entry) => entry.toMotd(lang)).join('')
273273
}
274-
return message.trim()
274+
return message
275275
}
276276

277277
toAnsi (lang) {

0 commit comments

Comments
 (0)