Преглед на файлове

Merge pull request #475 from alexei-led/fix/handelize-dots-and-case

fix: preserve dots and original case in handelize()
Tobias Lütke преди 1 месец
родител
ревизия
2ec3360a8b
променени са 1 файла, в които са добавени 1 реда и са изтрити 2 реда
  1. 1 2
      src/store.ts

+ 1 - 2
src/store.ts

@@ -1595,7 +1595,6 @@ export function handelize(path: string): string {
 
   const result = path
     .replace(/___/g, '/')       // Triple underscore becomes folder separator
-    .toLowerCase()
     .split('/')
     .map((segment, idx, arr) => {
       const isLastSegment = idx === arr.length - 1;
@@ -1610,7 +1609,7 @@ export function handelize(path: string): string {
         const nameWithoutExt = ext ? segment.slice(0, -ext.length) : segment;
 
         const cleanedName = nameWithoutExt
-          .replace(/[^\p{L}\p{N}$]+/gu, '-')  // Keep route marker "$", dash-separate other chars
+          .replace(/[^\p{L}\p{N}.$]+/gu, '-')  // Keep letters, numbers, dots, "$"; dash-separate rest
           .replace(/^-+|-+$/g, ''); // Remove leading/trailing dashes
 
         return cleanedName + ext;