Timothy Jaeryang Baek 3 months ago
parent
commit
5ce6c8ced3
1 changed files with 7 additions and 2 deletions
  1. 7 2
      src/lib/components/chat/MessageInput/Commands/Prompts.svelte

+ 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');