Skip to content

Commit 9a6fd21

Browse files
committed
search-replace間の改行が欠けていても良いものとする
1 parent 145604f commit 9a6fd21

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/api/chat/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ export async function POST(request: NextRequest) {
292292

293293
// Parse diffs from the full body content
294294
const diffRegex =
295-
/<{3,}\s*SEARCH\n([\s\S]*?)\n={3,}\n([\s\S]*?)\n>{3,}\s*REPLACE/g;
295+
/<{3,}\s*SEARCH\n*([\s\S]*?)\n*={3,}\n*([\s\S]*?)\n*>{3,}\s*REPLACE/g;
296296
const diffRaw: CreateChatDiff[] = [];
297297
for (const m of contentAfterHeader.matchAll(diffRegex)) {
298298
const search = m[1];

0 commit comments

Comments
 (0)