Remove React Markdown for human messages (#1562)

* Remove React Markdown for human messages

* Update globals.css

* add formatting

* formatting

---------

Co-authored-by: “Pablo <“pablo@danswer.ai”>
This commit is contained in:
pablodanswer 2024-06-03 18:20:46 -07:00 committed by GitHub
parent 0c642f25dd
commit e1e1f036a7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 15 deletions

View File

@ -518,22 +518,9 @@ export const HumanMessage = ({
</div>
</div>
) : typeof content === "string" ? (
<ReactMarkdown
className="prose max-w-full"
components={{
a: ({ node, ...props }) => (
<a
{...props}
className="text-blue-500 hover:text-blue-700"
target="_blank"
rel="noopener noreferrer"
/>
),
}}
remarkPlugins={[remarkGfm]}
>
<div className="flex flex-col preserve-lines prose max-w-full">
{content}
</ReactMarkdown>
</div>
) : (
content
)}

View File

@ -43,3 +43,8 @@
width: 8px; /* Vertical scrollbar width */
height: 8px; /* Horizontal scrollbar height */
}
/* Used to create alternatie to React Markdown */
.preserve-lines {
white-space: pre-wrap; /* Preserves whitespace and wraps text */
}