fix: copy multi lines when ==

This commit is contained in:
jialin
2026-02-24 11:07:53 +08:00
parent 0824f0c13b
commit 89765c19c4
2 changed files with 5 additions and 7 deletions
+5 -6
View File
@@ -80,13 +80,12 @@ const LabelSelector: React.FC<LabelSelectorProps> = ({
if (!clipboardText || clipboardText.indexOf('=') === -1) return;
e.preventDefault();
const lines = clipboardText
.split(/\r?\n/)
.map((line) => line.trim())
.filter((line) => line && line.includes('='));
const lines = _.split(clipboardText, /\r?\n/)
.map((line: string) => line.trim())
.filter((line: string) => line && line.includes('='));
const parsedData = lines.map((line) => {
const [key, value] = line.split('=').map((part) => part.trim());
const parsedData = lines.map((line: string) => {
const [key, value] = line.split(/=(.+)/).map((s) => s.trim());
return { key, value };
});
@@ -61,7 +61,6 @@ export default function useChatCompletion(
_.get(chunk, 'choices.0.delta.content', '') === null
? ''
: _.get(chunk, 'choices.0.delta.content', '');
console.log('deltaContent:', deltaContent);
reasonContentRef.current = reasonContentRef.current + deltaReasoningContent;
contentRef.current = contentRef.current + deltaContent;