diff --git a/src/components/chat/chat-row.tsx b/src/components/chat/chat-row.tsx index c9350021e..0a68bc3c0 100644 --- a/src/components/chat/chat-row.tsx +++ b/src/components/chat/chat-row.tsx @@ -104,7 +104,11 @@ const ChatRow: FC = (props) => { ); } - children[0] = (children[0] as string).replace("`▍`", "▍"); + if (Array.isArray(children)) { + children[0] = (children[0] as string).replace("`▍`", "▍"); + } else { + children = (children as string).replace("`▍`", "▍"); + } } const match = /language-(\w+)/.exec(className || "");