fix: 文件文字文件消息, 但是文字(trim)为空导致的显示问题

This commit is contained in:
CrescentLeaf
2025-11-16 21:58:59 +08:00
parent dec9068cc8
commit 30c09d0613

View File

@@ -29,9 +29,11 @@ function prettyFlatParsedMessage(html: string) {
let lastElementType = ''
function checkContinuousElement(tagName: string) {
if (lastElementType != tagName) {
if (lastElementType == 'chat-text')
ret += `<chat-text-container>${ls.map((v) => v.outerHTML).join('')}</chat-text-container>`
else
console.log(lastElementType, ls.map((v) => v.innerHTML))
if (textElementTags.indexOf(lastElementType) != -1) {
if (ls.map((v) => v.innerHTML).join('').trim() != '')
ret += `<chat-text-container>${ls.map((v) => v.outerHTML).join('')}</chat-text-container>`
} else
ret += ls.map((v) => v.outerHTML).join('')
ls = []
}