浏览代码

fix errors when no markdown options are provided #2956

Hakim El Hattab 4 年之前
父节点
当前提交
632cc78873
共有 3 个文件被更改,包括 5 次插入5 次删除
  1. 0 0
      plugin/markdown/markdown.esm.js
  2. 0 0
      plugin/markdown/markdown.js
  3. 5 5
      plugin/markdown/plugin.js

文件差异内容过多而无法显示
+ 0 - 0
plugin/markdown/markdown.esm.js


文件差异内容过多而无法显示
+ 0 - 0
plugin/markdown/markdown.js


+ 5 - 5
plugin/markdown/plugin.js

@@ -421,10 +421,10 @@ const Plugin = () => {
 
 			deck = reveal;
 
-			let { renderer, animateLists, ...markedOptions } = deck.getConfig().markdown;
+			let { renderer, animateLists, ...markedOptions } = deck.getConfig().markdown || {};
 
-			if (!renderer) {
-				let renderer = new marked.Renderer();
+			if( !renderer ) {
+				renderer = new marked.Renderer();
 
 				renderer.code = ( code, language ) => {
 
@@ -450,8 +450,8 @@ const Plugin = () => {
 				};
 			}
 
-			if (animateLists) {
-				renderer.listitem = (text) => `<li class="fragment">${text}</li>`;
+			if( animateLists === true ) {
+				renderer.listitem = text => `<li class="fragment">${text}</li>`;
 			}
 
 			marked.setOptions( {

部分文件因为文件数量过多而无法显示