Skip to content

Commit

Permalink
Fix display for std markdown without a language
Browse files Browse the repository at this point in the history
  • Loading branch information
Weves committed Jun 7, 2024
1 parent d56e6c4 commit 4274c11
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions web/src/app/chat/message/CodeBlock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import React from "react";
import { useState, ReactNode } from "react";
import { FiCheck, FiCopy } from "react-icons/fi";

const CODE_BLOCK_PADDING_TYPE = { padding: "1rem" };

interface CodeBlockProps {
className?: string | undefined;
children?: ReactNode;
Expand All @@ -24,9 +26,11 @@ export function CodeBlock({

if (!language) {
return (
<code {...props} className={`text-sm ${className}`}>
{children}
</code>
<pre style={CODE_BLOCK_PADDING_TYPE}>
<code {...props} className={`text-sm ${className}`}>
{children}
</code>
</pre>
);
}

Expand Down

0 comments on commit 4274c11

Please sign in to comment.