From 8a250c5812a711c637aadac495068ccb8d5376f6 Mon Sep 17 00:00:00 2001 From: Asher Haig Date: Wed, 18 Feb 2026 12:20:59 -0500 Subject: [PATCH] Added filename support for +-=[], for example as might be used in +=.cpp. --- src/store.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/store.ts b/src/store.ts index b68f8c0b..8c93b30d 100644 --- a/src/store.ts +++ b/src/store.ts @@ -967,7 +967,7 @@ export function handelize(path: string): string { const segments = path.split('/').filter(Boolean); const lastSegment = segments[segments.length - 1] || ''; const filenameWithoutExt = lastSegment.replace(/\.[^.]+$/, ''); - const hasValidContent = /[\p{L}\p{N}$]/u.test(filenameWithoutExt); + const hasValidContent = /[\p{L}\p{N}$+\-=\[\]]/u.test(filenameWithoutExt); if (!hasValidContent) { throw new Error(`handelize: path "${path}" has no valid filename content`); } @@ -986,14 +986,14 @@ 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 route marker "$" and operators, dash-separate other chars .replace(/^-+|-+$/g, ''); // Remove leading/trailing dashes return cleanedName + ext; } else { // For directories, just clean normally return segment - .replace(/[^\p{L}\p{N}$]+/gu, '-') + .replace(/[^\p{L}\p{N}$+\-=\[\]]+/gu, '-') .replace(/^-+|-+$/g, ''); } })