Update MessageBubble component to adjust Markdown styling and improve responsiveness
This commit is contained in:
@@ -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 &&
|
||||||
|
|||||||
Reference in New Issue
Block a user