fix errors when no markdown options are provided #2956

This commit is contained in:
Hakim El Hattab 2021-05-17 10:02:05 +02:00
parent 2c115b887a
commit 632cc78873
3 changed files with 7 additions and 7 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -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( {