From 0cfb4015c1516993405123ab35d928f7526f9869 Mon Sep 17 00:00:00 2001 From: Seidko Date: Fri, 1 Sep 2023 13:37:09 +0800 Subject: [PATCH] fix(mail): fix `br` rendering --- adapters/mail/src/message.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/adapters/mail/src/message.ts b/adapters/mail/src/message.ts index a107a5d9..34c909bd 100644 --- a/adapters/mail/src/message.ts +++ b/adapters/mail/src/message.ts @@ -39,7 +39,9 @@ export class MailMessageEncoder extends MessageEncoder { const { type, attrs, children } = element if (type === 'text') { this.buffer += attrs.content - } else if (['b', 'strong', 'i', 'em', 'u', 'ins', 's', 'del', 'p', 'code', 'li', 'ul', 'ol', 'blockquote', 'br'].includes(type)) { + } else if (type === 'br') { + this.buffer += '
' + } else if (['b', 'strong', 'i', 'em', 'u', 'ins', 's', 'del', 'p', 'code', 'li', 'ul', 'ol', 'blockquote'].includes(type)) { this.buffer += `<${type}>` await this.render(children) this.buffer += ``