Update MessageBubble component to adjust Markdown styling and improve responsiveness

This commit is contained in:
ecwu
2025-02-07 21:37:53 +00:00
parent d18040dca1
commit 8db892caf7

View File

@@ -336,37 +336,35 @@ export default function Message(props: { messageIndex: number }) {
) : chat.tool_calls ? (
<MessageToolCall chat={chat} copyToClipboard={copyToClipboard} />
) : renderMarkdown ? (
<div className="max-w-full md:max-w-[100%]">
<Markdown
remarkPlugins={[remarkMath]}
rehypePlugins={[rehypeKatex]}
disallowedElements={[
"script",
"iframe",
"object",
"embed",
"hr",
]}
// allowElement={(element) => {
// return [
// "p",
// "em",
// "strong",
// "del",
// "code",
// "inlineCode",
// "blockquote",
// "ul",
// "ol",
// "li",
// "pre",
// ].includes(element.tagName);
// }}
className={"prose"}
>
{getMessageText(chat)}
</Markdown>
</div>
<Markdown
remarkPlugins={[remarkMath]}
rehypePlugins={[rehypeKatex]}
disallowedElements={[
"script",
"iframe",
"object",
"embed",
"hr",
]}
// allowElement={(element) => {
// return [
// "p",
// "em",
// "strong",
// "del",
// "code",
// "inlineCode",
// "blockquote",
// "ul",
// "ol",
// "li",
// "pre",
// ].includes(element.tagName);
// }}
className={"prose max-w-none md:max-w-[75%]"}
>
{getMessageText(chat)}
</Markdown>
) : (
<div className="message-content max-w-full md:max-w-[100%]">
{chat.content &&