@@ -400,9 +400,9 @@ HtmlResWebpackPlugin.prototype.checkResource = function(
400400 compilation
401401) {
402402 let isProduction = this . options . env === "production" ,
403- linkRegex = new RegExp ( "(<link[^>]*href=(['\"]*)(.*?)(['\"]*).*?>)" , "ig" ) ,
403+ linkRegex = new RegExp ( "(<link(?: [^>]|\n) *href=(['\"]*)(.*?)(['\"]*).*?>)" , "ig" ) ,
404404 scriptRegex = new RegExp (
405- "(<script[^>]*src=(['\"]*)(.*?)(['\"]*).*?>(</script>)?)" ,
405+ "(<script(?: [^>]|\n) *src=(['\"]*)(.*?)(['\"]*).*?>(</script>)?)" ,
406406 "ig"
407407 ) ;
408408
@@ -425,7 +425,7 @@ HtmlResWebpackPlugin.prototype.checkResource = function(
425425 if ( ! ! ~ route . indexOf ( "__inline" ) ) {
426426 // css inline
427427 let styleInlineRegex = new RegExp (
428- "<link. *href=(s*?)*(.+)[?]__inline.*?(s*?)>" ,
428+ "<link(?:[^>]|\n) *href=(s*?)*(.+)[?]__inline.*?(s*?)>" ,
429429 "ig"
430430 ) ;
431431 route = this . inlineHtmlRes (
@@ -436,7 +436,7 @@ HtmlResWebpackPlugin.prototype.checkResource = function(
436436 ) ;
437437 } else {
438438 // css md5
439- let styleMd5Regex = new RegExp ( "<link. *href=(s*?)*(.+).*?(s*?)>" , "ig" ) ;
439+ let styleMd5Regex = new RegExp ( "<link(?:[^>]|\n) *href=(s*?)*(.+).*?(s*?)>" , "ig" ) ;
440440 let cssPublicPath = this . options . cssPublicPath || publicPath ;
441441 route = this . md5HtmlRes ( route , styleMd5Regex , cssPublicPath ) ;
442442 }
@@ -462,7 +462,7 @@ HtmlResWebpackPlugin.prototype.checkResource = function(
462462 if ( ! ! ~ route . indexOf ( "__inline" ) ) {
463463 // js inline
464464 let scriptInlineRegex = new RegExp (
465- "<script. *src=(s*?)*(.+)[?]__inline.*?(s*?)></script>" ,
465+ "<script(?:[^>]|\n) *src=(s*?)*(.+)[?]__inline.*?(s*?)></script>" ,
466466 "ig"
467467 ) ;
468468 route = this . inlineHtmlRes (
@@ -474,7 +474,7 @@ HtmlResWebpackPlugin.prototype.checkResource = function(
474474 } else {
475475 // js md5
476476 let scriptMd5Regex = new RegExp (
477- "<script. *src=(s*?)*(.+).*?(s*?)></script>" ,
477+ "<script(?:[^>]|\n) *src=(s*?)*(.+).*?(s*?)></script>" ,
478478 "ig"
479479 ) ;
480480 route = this . md5HtmlRes ( route , scriptMd5Regex , publicPath ) ;
0 commit comments