File tree Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -53,6 +53,8 @@ module.exports = function(content) {
5353 content = [ content ] ;
5454 links . forEach ( function ( link ) {
5555 if ( ! loaderUtils . isUrlRequest ( link . value , root ) ) return ;
56+
57+ if ( link . value . indexOf ( 'mailto:' ) > - 1 ) return ;
5658
5759 var uri = url . parse ( link . value ) ;
5860 if ( uri . hash !== null && uri . hash !== undefined ) {
Original file line number Diff line number Diff line change @@ -150,6 +150,11 @@ describe("loader", function() {
150150 'module.exports = "<img src=\\"" + require("./icons.svg") + "#hash\\">";'
151151 ) ;
152152 } ) ;
153+ it ( "should ignore anchor with 'mailto:' in the href attribute" , function ( ) {
154+ loader . call ( { } , '<a href="mailto:username@exampledomain.com"></a>' ) . should . be . eql (
155+ 'module.exports = "<a href=\\"mailto:username@exampledomain.com\\"></a>";'
156+ ) ;
157+ } ) ;
153158 it ( "should ignore interpolations by default" , function ( ) {
154159 loader . call ( { } , '<img src="${"Hello " + (1+1)}">' ) . should . be . eql (
155160 'module.exports = "<img src=\\"${\\"Hello \\" + (1+1)}\\">";'
You can’t perform that action at this time.
0 commit comments