fix(event): fix CR in text

This commit is contained in:
Il Harper 2024-04-17 02:11:48 +08:00
parent 323d5604db
commit fa64f9dca9
No known key found for this signature in database
GPG Key ID: 4B71FCA698E7E8EC

View File

@ -375,7 +375,13 @@ async function parseElements(
switch (m.textElement!.atType) { switch (m.textElement!.atType) {
case AtType.None: { case AtType.None: {
// 纯文本消息 // 纯文本消息
elements.push(ctx.chronocat.h.text(m.textElement?.content)) elements.push(
ctx.chronocat.h.text(
m
.textElement!.content.replaceAll('\r\n', '\n')
.replaceAll('\r', '\n'),
),
)
break break
} }