Timothy Jaeryang Baek 5 miesięcy temu
rodzic
commit
5ce6c8ced3

+ 7 - 2
src/lib/components/chat/MessageInput/Commands/Prompts.svelte

@@ -126,8 +126,13 @@
 		const lastLineWords = lastLine.split(' ');
 		const lastWord = lastLineWords.pop();
 
-		lastLineWords.push(text);
-		lines.push(lastLineWords.join(' '));
+		if ($settings?.richTextInput ?? true) {
+			lastLineWords.push(`${text.replace(/</g, '&lt;').replace(/>/g, '&gt;')}`);
+			lines.push(lastLineWords.join(' '));
+		} else {
+			lastLineWords.push(text);
+			lines.push(lastLineWords.join(' '));
+		}
 
 		prompt = lines.join('\n');