File tree Expand file tree Collapse file tree 3 files changed +6
-4
lines changed Expand file tree Collapse file tree 3 files changed +6
-4
lines changed Original file line number Diff line number Diff line change 55 },
66 "name" : " web-resource-inliner" ,
77 "description" : " Inlines img, script and link tags into the same file." ,
8- "version" : " 4.3.0 " ,
8+ "version" : " 4.3.1 " ,
99 "keywords" : [
1010 " inline" ,
1111 " js" ,
Original file line number Diff line number Diff line change @@ -190,7 +190,7 @@ module.exports = function( options, callback )
190190 ( settings . scripts || inlineAttributeRegex . test ( found [ 0 ] ) ) )
191191 {
192192 var src = unescape ( found [ 2 ] ) . trim ( ) ;
193- if ( src )
193+ if ( src && src . indexOf ( "#" ) !== 0 )
194194 {
195195 tasks . push ( replaceScript . bind (
196196 {
@@ -231,7 +231,7 @@ module.exports = function( options, callback )
231231 ( settings . images || inlineAttributeRegex . test ( found [ 0 ] ) ) )
232232 {
233233 var src = unescape ( found [ 2 ] ) . trim ( ) ;
234- if ( src ) {
234+ if ( src && src . indexOf ( "#" ) !== 0 ) {
235235 tasks . push ( replaceImg . bind (
236236 {
237237 element : found [ 0 ] ,
Original file line number Diff line number Diff line change @@ -525,7 +525,9 @@ describe( "html", function()
525525
526526 it ( "should not try to inline a link that starts with #" , function ( done )
527527 {
528- const content = '<link href="#" rel="stylesheet" /><link href="#aaa" rel="stylesheet" />' ;
528+ const content = '<link href="#" rel="stylesheet" /><link href="#aaa" rel="stylesheet" />'
529+ + '<img src="#" /><img src="#aaa" />'
530+ + '<a href="#" /><a href="#aaa" />' ;
529531
530532 inline . html ( {
531533 fileContent : content ,
You can’t perform that action at this time.
0 commit comments