From d5b44050858593d782038d636741da651a76f494 Mon Sep 17 00:00:00 2001 From: "ityaozm@gmail.com" Date: Tue, 15 Oct 2024 15:35:05 +0800 Subject: [PATCH] fix(app): Fix dumping issue - Replace escaped single quotes and newlines - Remove control characters --- app/Generators/GithubCopilotCliGenerator.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/Generators/GithubCopilotCliGenerator.php b/app/Generators/GithubCopilotCliGenerator.php index 602e169..cd2cd03 100644 --- a/app/Generators/GithubCopilotCliGenerator.php +++ b/app/Generators/GithubCopilotCliGenerator.php @@ -54,12 +54,12 @@ public function generate(string $prompt): string ->dump() ->match('/\{.*\}/s') ->dump() - // ->replace( - // ["\\'", PHP_EOL], - // ["'", ''] - // ) + ->replace( + ["\\'", PHP_EOL], + ["'", ''] + ) ->dump() - ->replaceMatches('/[[:cntrl:]]/mu', '') + // ->replaceMatches('/[[:cntrl:]]/mu', '') ->dump(); } }