Skip to content

Commit

Permalink
complete hook added
Browse files Browse the repository at this point in the history
  • Loading branch information
manfer committed Aug 8, 2015
1 parent 7f1ae75 commit 1c630b1
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions prism.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,6 @@ var _ = _self.Prism = {
parent.className = parent.className.replace(lang, '').replace(/\s+/g, ' ') + ' language-' + language;
}

if (!grammar) {
return;
}

var code = element.textContent;

if(!code) {
Expand All @@ -196,6 +192,11 @@ var _ = _self.Prism = {
code: code
};

if (!grammar) {
_.hooks.run('complete', env);
return;
}

_.hooks.run('before-highlight', env);

if (async && _self.Worker) {
Expand Down Expand Up @@ -228,6 +229,9 @@ var _ = _self.Prism = {

_.hooks.run('after-highlight', env);
}

_.hooks.run('complete', env);

},

highlight: function (text, grammar, language) {
Expand Down

0 comments on commit 1c630b1

Please sign in to comment.