We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 03f647c commit ab19bbaCopy full SHA for ab19bba
1 file changed
website/src/pages/edit.page.tsx
@@ -31,12 +31,13 @@ const NewPage = () => {
31
const [isNew, setIsNew] = useState(true)
32
33
const formatPath = (path: string) => {
34
- return path.startsWith("/")
35
- ? path
36
- : `/${path
37
- .toLowerCase()
38
- .replace(/ /g, "-")
39
- .replace(/[^a-z0-9-]/g, "")}`
+ let regularizedPath = path
+ .toLowerCase()
+ .replace(/ /g, "-")
+ .replace(/[^a-z0-9-]/g, "")
+ return regularizedPath.startsWith("/")
+ ? regularizedPath
40
+ : `/${regularizedPath}`
41
}
42
43
const [{ data }, reexec] = usePageByPathQuery({
0 commit comments