initialize plugins serially

This commit is contained in:
Hakim El Hattab
2020-04-16 16:40:46 +02:00
parent 561c3ff443
commit 08f29f08a2
5 changed files with 1270 additions and 869 deletions

View File

@ -15,13 +15,15 @@ export default {
* current reveal.js deck.
*/
init: function( deck ) {
if( typeof window.hljs !== 'undefined' ) {
marked.setOptions({
highlight: function( code, lang ) {
return window.hljs.highlightAuto( code, lang ? [lang] : null ).value;
}
});
}
// This should no longer be needed, as long as the highlight.js
// plugin is included after the markdown plugin
// if( typeof window.hljs !== 'undefined' ) {
// marked.setOptions({
// highlight: function( code, lang ) {
// return window.hljs.highlightAuto( code, lang ? [lang] : null ).value;
// }
// });
// }
// marked can be configured via reveal.js config options
var options = deck.getConfig().markdown;