Skip to content

Commit 7638654

Browse files
authored
Merge pull request #55 from nowscott/development
fix:修改代码框的渲染方式
2 parents 69e0457 + d67f6e4 commit 7638654

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/components/layout/MessageList.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ const MessageList = ({ messages, onDelete }) => {
5353
code: ({ node, inline, className, children, ...props }) => {
5454
const match = /language-(\w+)/.exec(className || '');
5555
const content = String(children).replace(/^\n+/, '').replace(/\n+$/, ''); // 去除开头和结尾的空行
56-
return !inline && match ? (
56+
return match ? (
5757
<CodeBlock language={match[1]} value={content} />
5858
) : (
5959
<code className={`${className} whitespace-pre-wrap break-words`} {...props}>

0 commit comments

Comments
 (0)