Skip to content

Commit d0bf1f9

Browse files
committed
fix(shared): preserve windows file link separators
1 parent 8191e46 commit d0bf1f9

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

‎packages/shared/src/markdownLinks.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,7 @@ function markdownLinkDestinationScanner(markdown: string) {
404404
}
405405

406406
export function decodeMarkdownLinkEscapes(href: string): string {
407+
if (isWindowsAbsolutePath(href) && !href.includes("&")) return href;
407408
return href.replace(/\\([!-/:-@[-`{-~])/g, "$1");
408409
}
409410

‎packages/shared/src/threadFindText.test.ts‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,12 @@ it("searches displayed prose and file-chip labels without hidden paths", () => {
8787
"a page.tsx · app/(a) and b page.tsx · app/(b)",
8888
]);
8989
}
90+
expect(
91+
assistantSegments(
92+
String.raw`[a](C:\repo\.a\page.tsx) and [b](C:\repo\.b\page.tsx)`,
93+
String.raw`C:\repo`,
94+
),
95+
).toEqual(["a page.tsx · repo/.a and b page.tsx · repo/.b"]);
9096
});
9197

9298
it("keeps fence paths literal and indexes file-chip labels in user messages", () => {

0 commit comments

Comments
 (0)