Skip to content

Commit

Permalink
fix errors when no markdown options are provided hakimel#2956
Browse files Browse the repository at this point in the history
  • Loading branch information
hakimel committed May 17, 2021
1 parent 2c115b8 commit 632cc78
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion plugin/markdown/markdown.esm.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion plugin/markdown/markdown.js

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions plugin/markdown/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) => {

Expand All @@ -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( {
Expand Down

0 comments on commit 632cc78

Please sign in to comment.