| 201 | |
| 202 | // doesn't handle multi-line comments or comments with { or } in them |
| 203 | function formatCSS( css ) { |
| 204 | |
| 205 | let indent = ''; |
| 206 | return css.split( '\n' ).map( ( line ) => { |
| 207 | |
| 208 | let currIndent = indent; |
| 209 | if ( line.includes( '{' ) ) { |
| 210 | |
| 211 | indent = indent + ' '; |
| 212 | |
| 213 | } else if ( line.includes( '}' ) ) { |
| 214 | |
| 215 | indent = indent.substring( 0, indent.length - 2 ); |
| 216 | currIndent = indent; |
| 217 | |
| 218 | } |
| 219 | |
| 220 | return `${currIndent}${line.trim()}`; |
| 221 | |
| 222 | } ).join( '\n' ); |
| 223 | |
| 224 | } |
| 225 | |
| 226 | async function getScript( url, scriptInfos ) { |
| 227 | |