Minor fixes

This commit is contained in:
Saoud Rizwan
2024-09-18 12:44:52 -04:00
parent 3ea20ab8db
commit 2825e03cef
3 changed files with 11 additions and 11 deletions

View File

@@ -372,7 +372,7 @@ const ChatTextArea = forwardRef<HTMLTextAreaElement, ChatTextAreaProps>(
highlightLayerRef.current.innerHTML = text
.replace(/\n$/, "\n\n")
.replace(/[<>&]/g, (c) => ({ "<": "&lt;", ">": "&gt;", "&": "&amp;" }[c] || c))
.replace(mentionRegexGlobal, '<mark class="mention-context-highlight">$&</mark>')
.replace(mentionRegexGlobal, '<mark class="mention-context-textarea-highlight">$&</mark>')
highlightLayerRef.current.scrollTop = textAreaRef.current.scrollTop
highlightLayerRef.current.scrollLeft = textAreaRef.current.scrollLeft

View File

@@ -351,9 +351,7 @@ export const highlightMentions = (text?: string, withShadow = true) => {
return (
<span
key={index}
className={`mention-context-highlight-${
withShadow ? "visible-with-shadow" : "visible-without-shadow"
}`}>
className={withShadow ? "mention-context-highlight-with-shadow" : "mention-context-highlight"}>
@{part}
</span>
)