Skip to content

Commit c81d51a

Browse files
authored
Merge pull request #14911 from ethereum/fix-edit-path
fix: clean relative edit path before constructing url
2 parents a6def6f + bdd291f commit c81d51a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/lib/utils/editPath.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,10 @@ import { join } from "path"
22

33
import { CONTENT_DIR, EDIT_CONTENT_URL } from "@/lib/constants"
44

5+
import { cleanPath } from "./url"
6+
57
export const getEditPath = (relativePath: string): string =>
6-
new URL(join(CONTENT_DIR, relativePath, "index.md"), EDIT_CONTENT_URL).href
8+
new URL(
9+
join(CONTENT_DIR, cleanPath(relativePath), "index.md"),
10+
EDIT_CONTENT_URL
11+
).href

0 commit comments

Comments
 (0)