Skip to content

Commit

Permalink
Merge pull request #874 from mAAdhaTTah/autoloader-compat
Browse files Browse the repository at this point in the history
Ensure show-invisibles compat with autoloader
  • Loading branch information
zeitgeist87 committed Feb 1, 2016
2 parents bcdd272 + c3cfb1f commit 5b9bf72
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions plugins/show-invisibles/prism-show-invisibles.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,12 @@ if (
return;
}

for (var language in Prism.languages) {
var tokens = Prism.languages[language];

tokens.tab = /\t/g;
tokens.crlf = /\r\n/g;
tokens.lf = /\n/g;
tokens.cr = /\r/g;
}
Prism.hooks.add('before-highlight', function(env) {
var tokens = env.grammar;

tokens.tab = /\t/g;
tokens.crlf = /\r\n/g;
tokens.lf = /\n/g;
tokens.cr = /\r/g;
});
})();

0 comments on commit 5b9bf72

Please sign in to comment.