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,15 @@ 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"
325+ ,
326326 },
327327 ],
328328 },
@@ -633,8 +633,8 @@ module.exports = {
633633 const isTemplateLiteralSupported = content[0 ] === " `" ;
634634
635635 return content
636- .replace ( / <%=/ g , isTemplateLiteralSupported ? ` \$ { ` : ' " +' )
637- .replace ( / %> / g , isTemplateLiteralSupported ? " }" : ' + "' );
636+ .replaceAll ( " <%=" , isTemplateLiteralSupported ? " ${ " : ' " +' )
637+ .replaceAll ( " %> " , isTemplateLiteralSupported ? " }" : ' + "' );
638638 },
639639 },
640640 },
@@ -665,8 +665,8 @@ module.exports = {
665665 const isTemplateLiteralSupported = content[0 ] === " `" ;
666666
667667 return content
668- .replace ( / <%=/ g , isTemplateLiteralSupported ? ` \$ { ` : ' " +' )
669- .replace ( / %> / g , isTemplateLiteralSupported ? " }" : ' + "' )
668+ .replaceAll ( " <%=" , isTemplateLiteralSupported ? " ${ " : ' " +' )
669+ .replaceAll ( " %> " , isTemplateLiteralSupported ? " }" : ' + "' )
670670 .replace (" my-value" , value);
671671 },
672672 },
0 commit comments