diff --git a/client/ui/chat/ChatFragment.tsx b/client/ui/chat/ChatFragment.tsx index 9f17fa1..726526c 100644 --- a/client/ui/chat/ChatFragment.tsx +++ b/client/ui/chat/ChatFragment.tsx @@ -85,9 +85,9 @@ const markedInstance = new marked.Marked({ } else switch (type) { case "UserMention": - return `` + return `PH` case "ChatMention": - return `` + return `PH` } return `(不支持的附件语法: ![${text}](${href}))` }, diff --git a/client/ui/chat/Message.tsx b/client/ui/chat/Message.tsx index a4f174c..024b8a8 100644 --- a/client/ui/chat/Message.tsx +++ b/client/ui/chat/Message.tsx @@ -33,8 +33,9 @@ function prettyFlatParsedMessage(html: string) { ] function checkContinuousElement(tagName: string) { if (lastElementType != tagName) { - console.log(lastElementType, ls.map((v) => v.innerHTML)) if (textElementTags.indexOf(lastElementType) != -1) { + // 由于 chat-mention 不是用内部元素实现的, 因此在这个元素的生成中必须放置占位字符串 + // 尽管显示上占位字符串不会显示, 但是在这里依然是会被处理的, 因为本身还是 innerHTML if (ls.map((v) => v.innerHTML).join('').trim() != '') ret += `${ls.map((v) => v.outerHTML).join('')}` } else