tasks/dentist.js
function inject (tag, shims){
      var added = shims.some(function(shim){
        var i = html.lastIndexOf(shim);
        if (i !== -1) {
          html = html.substr(0, i) + tag + html.substr(i);
          return true;
        }
        return false;
      });
      // Failing that, just append it.
      if (! added) {
        html += tag;
      }
    }
function inject (tag, shims){
      var added = shims.some(function(shim){
        var i = html.lastIndexOf(shim);
        if (i !== -1) {
          html = html.substr(0, i) + tag + html.substr(i);
          return true;
        }
        return false;
      });
      // Failing that, just append it.
      if (! added) {
        html += tag;
      }
    }
function inject ( tag , shims ) { var added = shims . some ( function ( shim ) { var i = html . lastIndexOf ( shim ) ; if ( i !== - 1 ) { html = html . substr ( 0 , i ) + tag + html . substr ( i ) ; return true ; } return false ; } ) ; // Failing that, just append it. if ( ! added ) { html += tag ; } }
Inject some text before a specified tag
Inject some text before a specified tag