Spaces:
Runtime error
Runtime error
matthoffner
commited on
Commit
โข
04a8f33
1
Parent(s):
74d34b9
Update components/Chat/ChatMessage.tsx
Browse files- components/Chat/ChatMessage.tsx +13 -14
components/Chat/ChatMessage.tsx
CHANGED
@@ -216,24 +216,23 @@ export const ChatMessage: FC<Props> = memo(({ message, messageIndex, onEdit }) =
|
|
216 |
components={{
|
217 |
code({ node, inline, className, children, ...props }) {
|
218 |
if (children.length) {
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
}
|
224 |
const match = /language-(\w+)/.exec(className || '');
|
225 |
return !inline ? (
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
)
|
233 |
) : (
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
);
|
238 |
},
|
239 |
table({ children }) {
|
|
|
216 |
components={{
|
217 |
code({ node, inline, className, children, ...props }) {
|
218 |
if (children.length) {
|
219 |
+
if (children[0] == 'โ') {
|
220 |
+
return <span className="animate-pulse cursor-default mt-1">โ</span>
|
221 |
+
}
|
222 |
+
children[0] = (children[0] as string).replace("`โ`", "โ")
|
223 |
}
|
224 |
const match = /language-(\w+)/.exec(className || '');
|
225 |
return !inline ? (
|
226 |
+
<CodeBlock
|
227 |
+
key={Math.random()}
|
228 |
+
language={(match && match[1]) || ''}
|
229 |
+
value={String(children).replace(/\n$/, '')}
|
230 |
+
{...props}
|
231 |
+
/>
|
|
|
232 |
) : (
|
233 |
+
<code className={className} {...props}>
|
234 |
+
{children}
|
235 |
+
</code>
|
236 |
);
|
237 |
},
|
238 |
table({ children }) {
|