🔍 fix: USE_REDIS condition, Markdown list counter, code highlights (#3806)

* fix: markdown rehype highlight accidental removal

* fix: USE_REDIS condition check

* fix: markdown list counter
This commit is contained in:
Danny Avila 2024-08-27 14:49:43 -04:00 committed by GitHub
parent f742b9972e
commit a267f6e0da
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 52 additions and 20 deletions

View file

@ -109,12 +109,11 @@ const cursor = ' ';
type TContentProps = {
content: string;
isEdited?: boolean;
showCursor?: boolean;
isLatestMessage: boolean;
};
const Markdown = memo(({ content = '', isEdited, showCursor, isLatestMessage }: TContentProps) => {
const Markdown = memo(({ content = '', showCursor, isLatestMessage }: TContentProps) => {
const LaTeXParsing = useRecoilValue<boolean>(store.LaTeXParsing);
const isInitializing = content === '';
@ -147,10 +146,6 @@ const Markdown = memo(({ content = '', isEdited, showCursor, isLatestMessage }:
);
}
if (isEdited === true || !isLatestMessage) {
rehypePlugins.pop();
}
return (
<ReactMarkdown
remarkPlugins={[supersub, remarkGfm, [remarkMath, { singleDollarTextMath: true }]]}

View file

@ -84,12 +84,7 @@ const DisplayMessage = ({ text, isCreatedByUser, message, showCursor }: TDisplay
)}
>
{!isCreatedByUser ? (
<Markdown
content={text}
isEdited={message.isEdited}
showCursor={showCursorState}
isLatestMessage={isLatestMessage}
/>
<Markdown content={text} showCursor={showCursorState} isLatestMessage={isLatestMessage} />
) : (
<>{text}</>
)}

View file

@ -41,12 +41,7 @@ const DisplayMessage = ({ text, isCreatedByUser = false, message, showCursor }:
)}
>
{!isCreatedByUser ? (
<Markdown
content={text}
isEdited={message.isEdited}
showCursor={showCursorState}
isLatestMessage={isLatestMessage}
/>
<Markdown content={text} showCursor={showCursorState} isLatestMessage={isLatestMessage} />
) : (
<>{text}</>
)}