Skip to content

Commit

Permalink
Merge pull request #136 from tedious/revert-124-master
Browse files Browse the repository at this point in the history
Revert "To identify coorect end of the regex"
  • Loading branch information
tedivm committed Jun 20, 2023
2 parents 7cb41f8 + ba35b9d commit 35a83e0
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/JShrink/Minifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,7 @@ protected function saveRegex()
$this->echo($this->b);

while (($this->a = $this->getChar()) !== false) {
if ($this->a === '/' && (preg_match('/g|\n|i|\)|\.|,|\s/', $this->peek()) === 1)) {
if ($this->a === '/') {
break;
}

Expand Down
3 changes: 0 additions & 3 deletions tests/Resources/jshrink/input/regex_end_string.js

This file was deleted.

5 changes: 4 additions & 1 deletion tests/Resources/jshrink/output/regex_close.js
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
function test(string){return(string||'').replace(/([\\!"#$%&'()*+,./:;<=>?@\[\]^`{|}~])/g,'\\$1')}
function test(string){return(string||'').replace(/([\\!"#$%&'()*+,./:;<=>?@\[\]^`{|}~])/g,
'\\$1'
)
}
1 change: 0 additions & 1 deletion tests/Resources/jshrink/output/regex_end_string.js

This file was deleted.

0 comments on commit 35a83e0

Please sign in to comment.