fix code highlighting in markdown decks

This commit is contained in:
Hakim El Hattab 2020-04-16 15:27:44 +02:00
parent d54353c4e1
commit 34458a988a
2 changed files with 3 additions and 4 deletions

File diff suppressed because one or more lines are too long

View file

@ -15,11 +15,10 @@ export default {
* current reveal.js deck. * current reveal.js deck.
*/ */
init: function( deck ) { init: function( deck ) {
if( typeof window.hljs !== 'undefined' ) {
if( typeof hljs !== 'undefined' ) {
marked.setOptions({ marked.setOptions({
highlight: function( code, lang ) { highlight: function( code, lang ) {
return hljs.highlightAuto( code, [lang] ).value; return window.hljs.highlightAuto( code, lang ? [lang] : null ).value;
} }
}); });
} }