nl_tokens: render string into array of js code and js src
pl_tokens: function render ( rawCode , idPre ) { var codeArr = { } ; // get js that is a src ref // TODO: need to check for `async` OR `defer` prop var re = / <script[^>]* src\s*=\s*'*"*([^'"]+)[^>]*>.*<\/script> / gi ; var HeaderCode = re . exec ( rawCode ) ; if ( HeaderCode ) { _ . forEach ( HeaderCode , function ( code , key ) { if ( 0 === key ) return ; codeArr [ ` ${ idPre } ${ key } ` ] = code ; } ) ; } // get js that is code re = / <script[^>]*>([^]+)<\/script> / gi ; HeaderCode = re . exec ( rawCode ) ; if ( HeaderCode ) { _ . forEach ( HeaderCode , function ( code , key ) { if ( 0 === key ) return ; codeArr [ ` ${ idPre } ${ key } ` ] = { code : <mask> } ; } ) ; } return codeArr ; }