*/}
-
-
- {text}
-
-
-
-
-
+ ) : edit ? (
+
+ {/*
*/}
+
+
+ {text}
- ) : (
-
- {/*
*/}
-
- {!isCreatedByUser ? wrapText(text) : text}
- {blinker && █}
-
+
+
+
- )}
+
+ ) : (
+
+ {/*
*/}
+
+ {!isCreatedByUser ? (
+
+ ) : (
+ text
+ )}
+
+
+ )}
-
enterEdit()}/>
+ enterEdit()}
+ />
>
);
diff --git a/client/src/components/Messages/TextWrapper.jsx b/client/src/components/Messages/TextWrapper.jsx
index 5719ee876b..75766bca0c 100644
--- a/client/src/components/Messages/TextWrapper.jsx
+++ b/client/src/components/Messages/TextWrapper.jsx
@@ -46,8 +46,9 @@ const inLineWrap = (parts) => {
});
};
-export default function TextWrapper({ text }) {
+export default function TextWrapper({ text, generateCursor }) {
let embedTest = false;
+ let result = null;
// to match unenclosed code blocks
if (text.match(/```/g)?.length === 1) {
@@ -137,13 +138,23 @@ export default function TextWrapper({ text }) {
}
});
- return <>{codeParts}>; // return the wrapped text
+ // return <>{codeParts}>; // return the wrapped text
+ result = <>{codeParts}>;
} else if (text.match(markupRegex)) {
// map over the parts and wrap any text between tildes with
tags
const parts = text.split(markupRegex);
const codeParts = inLineWrap(parts);
- return {codeParts}; // return the wrapped text
+ // return <>{codeParts}>; // return the wrapped text
+ result = <>{codeParts}>;
} else {
- return {text};
+ // return {text};
+ result = {text};
}
+
+ return (
+ <>
+ {result}
+ {(<>{generateCursor()}>)}
+ >
+ );
}
diff --git a/client/src/style.css b/client/src/style.css
index c4a03408b7..30fae19b40 100644
--- a/client/src/style.css
+++ b/client/src/style.css
@@ -1251,7 +1251,6 @@ html {
vertical-align: baseline;
}
-
/* .result-streaming>:not(ol):not(ul):not(pre):last-child:after,
.result-streaming>ol:last-child li:last-child:after,
.result-streaming>pre:last-child code:after,