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 ? ( ) : chat.tool_calls ? (
<MessageToolCall chat={chat} copyToClipboard={copyToClipboard} /> <MessageToolCall chat={chat} copyToClipboard={copyToClipboard} />
) : renderMarkdown ? ( ) : renderMarkdown ? (
<div className="max-w-full md:max-w-[100%]"> <Markdown
<Markdown remarkPlugins={[remarkMath]}
remarkPlugins={[remarkMath]} rehypePlugins={[rehypeKatex]}
rehypePlugins={[rehypeKatex]} disallowedElements={[
disallowedElements={[ "script",
"script", "iframe",
"iframe", "object",
"object", "embed",
"embed", "hr",
"hr", ]}
]} // allowElement={(element) => {
// allowElement={(element) => { // return [
// return [ // "p",
// "p", // "em",
// "em", // "strong",
// "strong", // "del",
// "del", // "code",
// "code", // "inlineCode",
// "inlineCode", // "blockquote",
// "blockquote", // "ul",
// "ul", // "ol",
// "ol", // "li",
// "li", // "pre",
// "pre", // ].includes(element.tagName);
// ].includes(element.tagName); // }}
// }} className={"prose max-w-none md:max-w-[75%]"}
className={"prose"} >
> {getMessageText(chat)}
{getMessageText(chat)} </Markdown>
</Markdown>
</div>
) : ( ) : (
<div className="message-content max-w-full md:max-w-[100%]"> <div className="message-content max-w-full md:max-w-[100%]">
{chat.content && {chat.content &&