7575type sources =
7676 | boolean
7777 | {
78- list? : Array < {
78+ list? : {
7979 tag? : string ;
8080 attribute? : string ;
8181 type? : string ;
@@ -85,7 +85,7 @@ type sources =
8585 attributes : string ,
8686 resourcePath : string ,
8787 ) => boolean ;
88- }> ;
88+ }[] ;
8989 urlFilter? : (
9090 attribute : string ,
9191 value : string ,
@@ -204,7 +204,7 @@ module.exports = {
204204Type:
205205
206206``` ts
207- type list = Array < {
207+ type list = {
208208 tag? : string ;
209209 attribute? : string ;
210210 type? : string ;
@@ -214,7 +214,7 @@ type list = Array<{
214214 attributes : string ,
215215 resourcePath : string ,
216216 ) => boolean ;
217- }> ;
217+ }[] ;
218218```
219219
220220Default: [ supported tags and attributes] ( #sources ) .
@@ -314,15 +314,14 @@ module.exports = {
314314 // Type of processing, can be `src` or `scrset`
315315 type: " src" ,
316316 // Allow to filter some attributes (optional)
317- filter : (tag , attribute , attributes , resourcePath ) => {
317+ filter : (tag , attribute , attributes , resourcePath ) =>
318318 // The `tag` argument contains a name of the HTML tag.
319319 // The `attribute` argument contains a name of the HTML attribute.
320320 // The `attributes` argument contains all attributes of the tag.
321321 // The `resourcePath` argument contains a path to the loaded HTML file.
322322
323323 // choose all HTML tags except img tag
324- return tag .toLowerCase () !== " img" ;
325- },
324+ tag .toLowerCase () !== " img" ,
326325 },
327326 ],
328327 },
@@ -633,8 +632,8 @@ module.exports = {
633632 const isTemplateLiteralSupported = content[0 ] === " `" ;
634633
635634 return content
636- .replace ( / <%=/ g , isTemplateLiteralSupported ? ` \$ { ` : ' " +' )
637- .replace ( / %> / g , isTemplateLiteralSupported ? " }" : ' + "' );
635+ .replaceAll ( " <%=" , isTemplateLiteralSupported ? " ${ " : ' " +' )
636+ .replaceAll ( " %> " , isTemplateLiteralSupported ? " }" : ' + "' );
638637 },
639638 },
640639 },
@@ -665,8 +664,8 @@ module.exports = {
665664 const isTemplateLiteralSupported = content[0 ] === " `" ;
666665
667666 return content
668- .replace ( / <%=/ g , isTemplateLiteralSupported ? ` \$ { ` : ' " +' )
669- .replace ( / %> / g , isTemplateLiteralSupported ? " }" : ' + "' )
667+ .replaceAll ( " <%=" , isTemplateLiteralSupported ? " ${ " : ' " +' )
668+ .replaceAll ( " %> " , isTemplateLiteralSupported ? " }" : ' + "' )
670669 .replace (" my-value" , value);
671670 },
672671 },
0 commit comments