CS-Notes/docs/_style/prism-master/plugins/show-invisibles/prism-show-invisibles.js

22 lines
350 B
JavaScript
Raw Normal View History

2018-12-19 14:09:39 +08:00
(function(){
if (
typeof self !== 'undefined' && !self.Prism ||
typeof global !== 'undefined' && !global.Prism
) {
return;
}
Prism.hooks.add('before-highlight', function(env) {
var tokens = env.grammar;
if (!tokens) return;
tokens.tab = /\t/g;
tokens.crlf = /\r\n/g;
tokens.lf = /\n/g;
tokens.cr = /\r/g;
tokens.space = / /g;
});
})();