Skip to content

Commit

Permalink
fix: should add the escape character for the regexps (#5811)
Browse files Browse the repository at this point in the history
  • Loading branch information
yimingjfe authored Jun 11, 2024
1 parent 0fce81a commit a481488
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .changeset/metal-lies-taste.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@modern-js/server-core': patch
---

fix: should add the escape character for the regexps
fix: 为正则表达式添加转义字符
4 changes: 2 additions & 2 deletions packages/server/core/src/base/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ export const AGGRED_DIR = {

export const REPLACE_REG = {
before: {
head: '<head\b[^>]*>',
body: '<body\b[^>]*>',
head: '<head\\b[^>]*>',
body: '<body\\b[^>]*>',
},
after: {
head: '</head>',
Expand Down

0 comments on commit a481488

Please sign in to comment.