Skip to content

Commit

Permalink
fix: update regex to allow whitespace & + in Windows path (#74)
Browse files Browse the repository at this point in the history
Co-authored-by: Dominik G. <[email protected]>
Co-authored-by: Haoqun Jiang <[email protected]>
  • Loading branch information
3 people authored Aug 5, 2024
1 parent 7984cc3 commit 9779c46
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/launch-editor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ function launchEditor (file, specifiedEditor, onErrorCallback) {
// and
// https://github.com/facebook/create-react-app/pull/5431)

// Allows alphanumeric characters, periods, dashes, slashes, and underscores.
const WINDOWS_CMD_SAFE_FILE_NAME_PATTERN = /^([A-Za-z]:[/\\])?[\p{L}0-9/.\-_\\]+$/u
// Allows alphanumeric characters, periods, dashes, slashes, underscores, plus and space.
const WINDOWS_CMD_SAFE_FILE_NAME_PATTERN = /^([A-Za-z]:[/\\])?[\p{L}0-9/.\-\\_+ ]+$/u
if (
process.platform === 'win32' &&
!WINDOWS_CMD_SAFE_FILE_NAME_PATTERN.test(fileName.trim())
Expand Down

0 comments on commit 9779c46

Please sign in to comment.