fix code highlighting in markdown decks

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

No files matched your search

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