Browse Source

escape page path

Yuki Takei 1 year ago
parent
commit
5e9dd86900
1 changed files with 1 additions and 1 deletions
  1. 1 1
      packages/core/src/utils/page-path-utils/index.ts

+ 1 - 1
packages/core/src/utils/page-path-utils/index.ts

@@ -286,7 +286,7 @@ export const generateChildrenRegExp = (path: string): RegExp => {
 
   // https://regex101.com/r/mrDJrx/1
   // ex. /parent/any_child OR /any_level1
-  return new RegExp(`^${path}(\\/[^/]+)\\/?$`);
+  return new RegExp(`^${escapeStringRegexp(path)}(\\/[^/]+)\\/?$`);
 };
 
 /**