75
75
type sources =
76
76
| boolean
77
77
| {
78
- list? : Array < {
78
+ list? : {
79
79
tag? : string ;
80
80
attribute? : string ;
81
81
type? : string ;
@@ -85,7 +85,7 @@ type sources =
85
85
attributes : string ,
86
86
resourcePath : string ,
87
87
) => boolean ;
88
- }> ;
88
+ }[] ;
89
89
urlFilter? : (
90
90
attribute : string ,
91
91
value : string ,
@@ -204,7 +204,7 @@ module.exports = {
204
204
Type:
205
205
206
206
``` ts
207
- type list = Array < {
207
+ type list = {
208
208
tag? : string ;
209
209
attribute? : string ;
210
210
type? : string ;
@@ -214,7 +214,7 @@ type list = Array<{
214
214
attributes : string ,
215
215
resourcePath : string ,
216
216
) => boolean ;
217
- }> ;
217
+ }[] ;
218
218
```
219
219
220
220
Default: [ supported tags and attributes] ( #sources ) .
@@ -314,15 +314,15 @@ module.exports = {
314
314
// Type of processing, can be `src` or `scrset`
315
315
type: " src" ,
316
316
// Allow to filter some attributes (optional)
317
- filter : (tag , attribute , attributes , resourcePath ) => {
317
+ filter : (tag , attribute , attributes , resourcePath ) =>
318
318
// The `tag` argument contains a name of the HTML tag.
319
319
// The `attribute` argument contains a name of the HTML attribute.
320
320
// The `attributes` argument contains all attributes of the tag.
321
321
// The `resourcePath` argument contains a path to the loaded HTML file.
322
322
323
323
// choose all HTML tags except img tag
324
- return tag .toLowerCase () !== " img" ;
325
- } ,
324
+ tag .toLowerCase () !== " img"
325
+ ,
326
326
},
327
327
],
328
328
},
@@ -633,8 +633,8 @@ module.exports = {
633
633
const isTemplateLiteralSupported = content[0 ] === " `" ;
634
634
635
635
return content
636
- .replace ( / <%=/ g , isTemplateLiteralSupported ? ` \$ { ` : ' " +' )
637
- .replace ( / %> / g , isTemplateLiteralSupported ? " }" : ' + "' );
636
+ .replaceAll ( " <%=" , isTemplateLiteralSupported ? " ${ " : ' " +' )
637
+ .replaceAll ( " %> " , isTemplateLiteralSupported ? " }" : ' + "' );
638
638
},
639
639
},
640
640
},
@@ -665,8 +665,8 @@ module.exports = {
665
665
const isTemplateLiteralSupported = content[0 ] === " `" ;
666
666
667
667
return content
668
- .replace ( / <%=/ g , isTemplateLiteralSupported ? ` \$ { ` : ' " +' )
669
- .replace ( / %> / g , isTemplateLiteralSupported ? " }" : ' + "' )
668
+ .replaceAll ( " <%=" , isTemplateLiteralSupported ? " ${ " : ' " +' )
669
+ .replaceAll ( " %> " , isTemplateLiteralSupported ? " }" : ' + "' )
670
670
.replace (" my-value" , value);
671
671
},
672
672
},
0 commit comments