Browse Source

Regex improvements

n1474335 2 years ago
parent
commit
a24fdf4250
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/core/Utils.mjs

+ 2 - 2
src/core/Utils.mjs

@@ -824,8 +824,8 @@ class Utils {
         }
         }
 
 
         if (removeScriptAndStyle) {
         if (removeScriptAndStyle) {
-            htmlStr = recursiveRemove(/<script[^>]*>[/s/S]*?<\/script[^>]*>/gi, htmlStr);
-            htmlStr = recursiveRemove(/<style[^>]*>[/s/S]*?<\/style[^>]*>/gi, htmlStr);
+            htmlStr = recursiveRemove(/<script[^>]*>(\s|\S)*?<\/script[^>]*>/gi, htmlStr);
+            htmlStr = recursiveRemove(/<style[^>]*>(\s|\S)*?<\/style[^>]*>/gi, htmlStr);
         }
         }
         return recursiveRemove(/<[^>]+>/g, htmlStr);
         return recursiveRemove(/<[^>]+>/g, htmlStr);
     }
     }