Explorar el Código

improve regexp to exclude url(data...)

Yuki Takei hace 7 años
padre
commit
95bbfe9466
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      src/lib/service/cdn-resources-downloader.js

+ 1 - 1
src/lib/service/cdn-resources-downloader.js

@@ -100,7 +100,7 @@ class CdnResourcesDownloader {
    */
   generateReplaceUrlInCssStream(cdnResource, assetsResourcesStore, webroot) {
     return replaceStream(
-      /url\((?!"data:)["']?(.+?)["']?\)/g,    // https://regex101.com/r/Sds38A/2
+      /url\((?!['"]?data:)["']?(.+?)["']?\)/g,    // https://regex101.com/r/Sds38A/3
       (match, url) => {
         // generate URL Object
         const parsedUrl = url.startsWith('http')