mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 00:40:14 +01:00
fix(Content.jsx): remove 'z-index: 1;' from currentContent variable
fix(Content.jsx): exclude rehypePlugins if isIFrame is true fix(Content.jsx): update content rendering to use currentContent variable
This commit is contained in:
parent
712be248be
commit
3a112a344d
1 changed files with 7 additions and 4 deletions
|
|
@ -33,6 +33,8 @@ const Content = React.memo(({ content, message }) => {
|
|||
const latestMessage = useRecoilValue(store.latestMessage);
|
||||
const isInitializing = content === '<span className="result-streaming">█</span>';
|
||||
const isLatestMessage = message?.messageId === latestMessage?.messageId;
|
||||
const currentContent = content?.replace('z-index: 1;', '') ?? '';
|
||||
const isIFrame = currentContent.includes('<iframe');
|
||||
|
||||
useEffect(() => {
|
||||
let timer1, timer2;
|
||||
|
|
@ -68,9 +70,8 @@ const Content = React.memo(({ content, message }) => {
|
|||
[rehypeRaw],
|
||||
];
|
||||
|
||||
if (!isInitializing || !isLatestMessage) {
|
||||
//commented out to fix bing image creator errors
|
||||
//rehypePlugins.pop();
|
||||
if ((!isInitializing || !isLatestMessage) && !isIFrame) {
|
||||
rehypePlugins.pop();
|
||||
}
|
||||
|
||||
return (
|
||||
|
|
@ -83,7 +84,9 @@ const Content = React.memo(({ content, message }) => {
|
|||
p,
|
||||
}}
|
||||
>
|
||||
{isLatestMessage && isSubmitting && !isInitializing ? (content ?? '') + cursor : content}
|
||||
{isLatestMessage && isSubmitting && !isInitializing
|
||||
? currentContent + cursor
|
||||
: currentContent}
|
||||
</ReactMarkdown>
|
||||
);
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue