Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions apps/web/src/components/ChatMarkdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,15 @@ function ChatMarkdown({ text, cwd, isStreaming = false }: ChatMarkdownProps) {
/>
);
},
p: ({ node: _node, ...props }) => <p dir="auto" {...props} />,
h1: ({ node: _node, ...props }) => <h1 dir="auto" {...props} />,
h2: ({ node: _node, ...props }) => <h2 dir="auto" {...props} />,
h3: ({ node: _node, ...props }) => <h3 dir="auto" {...props} />,
h4: ({ node: _node, ...props }) => <h4 dir="auto" {...props} />,
h5: ({ node: _node, ...props }) => <h5 dir="auto" {...props} />,
h6: ({ node: _node, ...props }) => <h6 dir="auto" {...props} />,
li: ({ node: _node, ...props }) => <li dir="auto" {...props} />,
blockquote: ({ node: _node, ...props }) => <blockquote dir="auto" {...props} />,
pre({ node: _node, children, ...props }) {
const codeBlock = extractCodeBlock(children);
if (!codeBlock) {
Expand Down
15 changes: 12 additions & 3 deletions apps/web/src/components/chat/MessagesTimeline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -720,7 +720,10 @@ const UserMessageBody = memo(function UserMessageBody(props: {
}

return (
<div className="wrap-break-word whitespace-pre-wrap font-mono text-sm leading-relaxed text-foreground">
<div
dir="auto"
className="wrap-break-word whitespace-pre-wrap font-mono text-sm leading-relaxed text-foreground"
>
{inlineNodes}
</div>
);
Expand Down Expand Up @@ -748,7 +751,10 @@ const UserMessageBody = memo(function UserMessageBody(props: {
}

return (
<div className="wrap-break-word whitespace-pre-wrap font-mono text-sm leading-relaxed text-foreground">
<div
dir="auto"
className="wrap-break-word whitespace-pre-wrap font-mono text-sm leading-relaxed text-foreground"
>
{inlineNodes}
</div>
);
Expand All @@ -759,7 +765,10 @@ const UserMessageBody = memo(function UserMessageBody(props: {
}

return (
<pre className="whitespace-pre-wrap wrap-break-word font-mono text-sm leading-relaxed text-foreground">
<pre
dir="auto"
className="whitespace-pre-wrap wrap-break-word font-mono text-sm leading-relaxed text-foreground"
>
{props.text}
</pre>
);
Expand Down
Loading