mirror of
https://github.com/CyC2018/CS-Notes.git
synced 2025-07-15 00:52:20 +08:00
use prism-tomorrow.css
This commit is contained in:
@ -0,0 +1,31 @@
|
||||
(function(){
|
||||
|
||||
if (
|
||||
(typeof self === 'undefined' || !self.Prism) &&
|
||||
(typeof global === 'undefined' || !global.Prism)
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
var options = {
|
||||
classMap: {}
|
||||
};
|
||||
Prism.plugins.customClass = {
|
||||
map: function map(cm) {
|
||||
options.classMap = cm;
|
||||
},
|
||||
prefix: function prefix(string) {
|
||||
options.prefixString = string;
|
||||
}
|
||||
}
|
||||
|
||||
Prism.hooks.add('wrap', function (env) {
|
||||
if (!options.classMap && !options.prefixString) {
|
||||
return;
|
||||
}
|
||||
env.classes = env.classes.map(function(c) {
|
||||
return (options.prefixString || '') + (options.classMap[c] || c);
|
||||
});
|
||||
});
|
||||
|
||||
})();
|
Reference in New Issue
Block a user