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) {
53
53
content = [ content ] ;
54
54
links . forEach ( function ( link ) {
55
55
if ( ! loaderUtils . isUrlRequest ( link . value , root ) ) return ;
56
+
57
+ if ( link . value . indexOf ( 'mailto:' ) > - 1 ) return ;
56
58
57
59
var uri = url . parse ( link . value ) ;
58
60
if ( uri . hash !== null && uri . hash !== undefined ) {
Original file line number Diff line number Diff line change @@ -150,6 +150,11 @@ describe("loader", function() {
150
150
'module.exports = "<img src=\\"" + require("./icons.svg") + "#hash\\">";'
151
151
) ;
152
152
} ) ;
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
+ } ) ;
153
158
it ( "should ignore interpolations by default" , function ( ) {
154
159
loader . call ( { } , '<img src="${"Hello " + (1+1)}">' ) . should . be . eql (
155
160
'module.exports = "<img src=\\"${\\"Hello \\" + (1+1)}\\">";'
You can’t perform that action at this time.
0 commit comments