Components v2 support

This commit is contained in:
Cadence Ember
2026-01-30 19:22:13 +13:00
parent fca4c75522
commit e3e38b9f24
5 changed files with 376 additions and 10 deletions
+2 -1
View File
@@ -106,7 +106,8 @@ class MatrixStringBuilder {
if (formattedBody == undefined) formattedBody = body
if (this.body.length && this.body.slice(-1) !== "\n") this.body += "\n\n"
this.body += body
formattedBody = `<p>${formattedBody}</p>`
const match = formattedBody.match(/^<([a-zA-Z]+[a-zA-Z0-9]*)/)
if (!match || !BLOCK_ELEMENTS.includes(match[1].toUpperCase())) formattedBody = `<p>${formattedBody}</p>`
this.formattedBody += formattedBody
}
return this