mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-23 20:00:15 +01:00
🔍 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:
parent
f742b9972e
commit
a267f6e0da
6 changed files with 52 additions and 20 deletions
|
|
@ -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 }]]}
|
||||
|
|
|
|||
|
|
@ -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}</>
|
||||
)}
|
||||
|
|
|
|||
|
|
@ -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}</>
|
||||
)}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue