Browse Source

Regex improvements

n1474335 2 năm trước cách đây
mục cha
commit
a24fdf4250
1 tập tin đã thay đổi với 2 bổ sung2 xóa
  1. 2 2
      src/core/Utils.mjs

+ 2 - 2
src/core/Utils.mjs

@@ -824,8 +824,8 @@ class Utils {
         }
 
         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);
     }