From b2574fd083afc878998533ca1190590d3dfd32d4 Mon Sep 17 00:00:00 2001 From: muhammad-junaid1 Date: Thu, 17 Apr 2025 11:05:34 +0500 Subject: [PATCH] fixed & being passed in ai prompt (url) --- freewrite/ContentView.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/freewrite/ContentView.swift b/freewrite/ContentView.swift index cc4113a..83314bb 100644 --- a/freewrite/ContentView.swift +++ b/freewrite/ContentView.swift @@ -1058,7 +1058,7 @@ struct ContentView: View { let trimmedText = text.trimmingCharacters(in: .whitespacesAndNewlines) let fullText = aiChatPrompt + "\n\n" + trimmedText - if let encodedText = fullText.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed), + if let encodedText = fullText.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)?.replacingOccurrences(of: "&", with: "%26"), let url = URL(string: "https://chat.openai.com/?m=" + encodedText) { NSWorkspace.shared.open(url) } @@ -1068,7 +1068,7 @@ struct ContentView: View { let trimmedText = text.trimmingCharacters(in: .whitespacesAndNewlines) let fullText = claudePrompt + "\n\n" + trimmedText - if let encodedText = fullText.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed), + if let encodedText = fullText.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)?.replacingOccurrences(of: "&", with: "%26"), let url = URL(string: "https://claude.ai/new?q=" + encodedText) { NSWorkspace.shared.open(url) } @@ -1305,4 +1305,4 @@ extension NSView { #Preview { ContentView() -} \ No newline at end of file +}