code: function ($parse) {
    return {
      restrict: 'EA',
      controller: 'HljsCtrl',
      compile: function(tElm, tAttrs, transclude) {
        // get static code
        // strip the starting "new line" character
        var staticHTML = tElm[0].innerHTML.replace(/^(\r\n|\r|\n)/m, ''),
            staticText = tElm[0].textContent.replace(/^(\r\n|\r|\n)/m, '');
  
        // put template
        tElm.html('<pre><code class="hljs"></code></pre>');
  
        return function postLink(scope, iElm, iAttrs, ctrl) {
          var escapeCheck;
  
          if (angular.isDefined(iAttrs.escape)) {
            escapeCheck = $parse(iAttrs.escape);
          } else if (angular.isDefined(iAttrs.noEscape)) {
            escapeCheck = $parse('false');
          }
  
          ctrl.init(iElm.find('code'));
  
          if (iAttrs.onhighlight) {
            ctrl.highlightCallback(function () {
              scope.$eval(iAttrs.onhighlight);
            });
          }
  
          if ((staticHTML || staticText) && shouldHighlightStatics(iAttrs)) {
  
            var code;
  
            // Auto-escape check
            // default to "true"
            if (escapeCheck && !escapeCheck(scope)) {
              code = staticText;
            }
            else {
              code = staticHTML;
            }
  
            ctrl.highlight(code);
          }
  
          scope.$on('$destroy', function () {
            ctrl.release();
          });
        };
      }
    };
  }
docs: /*@ngInject