mirror of
https://github.com/sqlchat/sqlchat.git
synced 2025-07-28 17:53:21 +08:00
chore: update message loader
This commit is contained in:
@ -42,12 +42,12 @@ const MessageView = (props: Props) => {
|
||||
pre({ node, className, children, ...props }) {
|
||||
const child = children[0] as ReactElement;
|
||||
const match = /language-(\w+)/.exec(child.props.className || "");
|
||||
const language = match ? match[1] : "plain";
|
||||
const language = match ? match[1] : "text";
|
||||
return (
|
||||
<pre className={`${className || ""} p-0 w-full`} {...props}>
|
||||
<CodeBlock
|
||||
key={Math.random()}
|
||||
language={language || "plain"}
|
||||
language={language || "text"}
|
||||
value={String(child.props.children).replace(/\n$/, "")}
|
||||
{...props}
|
||||
/>
|
||||
|
Reference in New Issue
Block a user