瀏覽代碼

fix code highlighting in markdown decks

Hakim El Hattab 5 年之前
父節點
當前提交
34458a988a
共有 2 個文件被更改,包括 2 次插入3 次删除
  1. 0 0
      dist/plugin/markdown.js
  2. 2 3
      plugin/markdown/markdown.js

File diff suppressed because it is too large
+ 0 - 0
dist/plugin/markdown.js


+ 2 - 3
plugin/markdown/markdown.js

@@ -15,11 +15,10 @@ export default {
 	 * current reveal.js deck.
 	 * current reveal.js deck.
 	 */
 	 */
 	init: function( deck ) {
 	init: function( deck ) {
-
-		if( typeof hljs !== 'undefined' ) {
+		if( typeof window.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;
 				}
 				}
 			});
 			});
 		}
 		}

Some files were not shown because too many files changed in this diff