now not adding title slide if meta information is not available

feature/settings-window
Michael Ochmann 3 years ago
parent 61cc5524b7
commit 5955e346be
  1. 15
      src/Parser.js

@ -23,7 +23,7 @@ const tokenize = string => {
const injectTitle = (deck, meta) => {
const title = [];
if (meta.title)
if (meta?.title)
title.push({
type : "heading",
level : 1,
@ -34,7 +34,7 @@ const injectTitle = (deck, meta) => {
}
]
});
if (meta.author)
if (meta?.author)
title.push({
type : "paragraph",
tokens : [
@ -44,7 +44,7 @@ const injectTitle = (deck, meta) => {
},
]
});
if (meta.email)
if (meta?.email)
title.push({
type : "paragraph",
tokens : [
@ -54,9 +54,12 @@ const injectTitle = (deck, meta) => {
},
]
});
const slide = new Slide(title);
slide.title = true;
deck.unshift(slide);
if (title.length > 0) {
const slide = new Slide(title);
slide.title = true;
deck.unshift(slide);
}
return deck;
}

Loading…
Cancel
Save