浏览代码

add animateLists option to markdown plugin

Add an "animateLists" option to the markdown plugin that animates all
lists by default.
Ujjwal Sharma 4 年之前
父节点
当前提交
00acc730f0
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5 1
      plugin/markdown/plugin.js

+ 5 - 1
plugin/markdown/plugin.js

@@ -424,7 +424,7 @@ const Plugin = () => {
 
 
 			deck = reveal;
 			deck = reveal;
 
 
-			let { renderer, ...markedOptions } = deck.getConfig().markdown;
+			let { renderer, animateLists, ...markedOptions } = deck.getConfig().markdown;
 
 
 			if (!renderer) {
 			if (!renderer) {
 				let renderer = new marked.Renderer();
 				let renderer = new marked.Renderer();
@@ -453,6 +453,10 @@ const Plugin = () => {
 				};
 				};
 			}
 			}
 
 
+			if (animateLists) {
+				renderer.listitem = (text) => `<li class="fragment">${text}</li>`;
+			}
+
 			marked.setOptions( {
 			marked.setOptions( {
 				renderer,
 				renderer,
 				...markedOptions
 				...markedOptions