now not adding title slide if meta information is not available

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

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

Loading…
Cancel
Save