feat(web): add safe rich text formatting for message rendering
This commit is contained in:
@@ -5,6 +5,7 @@ import type { Message, MessageReaction } from "../chat/types";
|
||||
import { useAuthStore } from "../store/authStore";
|
||||
import { useChatStore } from "../store/chatStore";
|
||||
import { formatTime } from "../utils/format";
|
||||
import { formatMessageHtml } from "../utils/formatMessage";
|
||||
|
||||
type ContextMenuState = {
|
||||
x: number;
|
||||
@@ -555,7 +556,7 @@ function renderContent(messageType: string, text: string | null) {
|
||||
</a>
|
||||
);
|
||||
}
|
||||
return <p className="whitespace-pre-wrap break-words">{text}</p>;
|
||||
return <p className="whitespace-pre-wrap break-words" dangerouslySetInnerHTML={{ __html: formatMessageHtml(text) }} />;
|
||||
}
|
||||
|
||||
function renderStatus(status: string | undefined): string {
|
||||
|
||||
Reference in New Issue
Block a user