-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: update regex to allow whitespace & +
in Windows path
#74
Conversation
Hey, would you be interested in adding cc @sodatea this would be the "expand allow list" i mentioned, might be a stop-gap solution until you find the time to implement propper escaping. |
Why not, I didn't use sveltkit but I think it can be good for sveltkit user. |
i wonder if you want |
Co-authored-by: Dominik G. <dominik.goepel@gmx.de>
Co-authored-by: Dominik G. <dominik.goepel@gmx.de>
I prefer to use the \s, it cover more cases like tabs, line breaks etc... In case of ^^ |
is it possible to have line breaks or tabs in a file path on windows? (that file system never fails to impress, just not sure if in a positive way) |
I really don't know... You prefer to use only spaces ? |
unless they are possible/allowed, i would prefer just space, but maybe @sodatea has a different opinion. It would be good to get this merged soonish so we can include it in vite 5.5. |
+
in Windows path
According to https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file CR, LF and TABs are not allowed in a file path. So I think a single space character should suffice. |
As for other special characters, there seem to be many more to add for compatibility with all the popular filesystem-based routing solutions, but I'll leave that to a later PR. |
yeahh @sodatea it's still an issue on Win11 Reference |
I don't think banning characters is the solution to this problem. Even if you did find all the characters that are currently used by every system that depends on Vite why prevent some creative new use of valid special characters in the future? This entire feature seems very short sighted. |
Fixes yyx990803#35 Fixes yyx990803#76 Closes yyx990803#54 Closes yyx990803#57 Fixes yyx990803#74#issuecomment-2269583713
Fixes yyx990803#35 Fixes yyx990803#76 Closes yyx990803#54 Closes yyx990803#57 Fixes yyx990803#74#issuecomment-2269583713
Updated regex to authorize whitespace in file path.
Many projects has a whitespace in folder name (like me). Many time it doesn't affect anything but here it prevent file to open.
Let me know !