Skip to content

Commit af303b7

Browse files
authored
Merge pull request #216 from power88/frontend-fix
fix <code> element runs out of the chat interface
2 parents beb8e01 + 182f30a commit af303b7

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

react/src/components/chat/Markdown.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,14 @@ const NonMemoizedMarkdown: React.FC<MarkdownProps> = ({ children }) => {
9292
return !(props as any).inline && match ? (
9393
<pre
9494
{...props}
95-
className={`${className} text-sm w-full max-w-full overflow-x-auto p-3 rounded-lg mt-2 bg-zinc-800 text-white dark:bg-zinc-300 dark:text-black whitespace-pre break-all`}
95+
className={`${className} text-sm w-full max-w-full overflow-x-auto p-3 rounded-lg mt-2 bg-zinc-800 text-white dark:bg-zinc-300 dark:text-black whitespace-pre-wrap break-all`}
9696
>
9797
<code
9898
className={match[1]}
9999
style={{
100100
wordBreak: 'break-all',
101+
whiteSpace: 'pre-wrap',
102+
wordWrap: 'break-word'
101103
}}
102104
>
103105
{children}

0 commit comments

Comments
 (0)