Skip to content

Commit 93b5d4e

Browse files
web: markdown: display markdown even when frontmatter is missing
Make the check for the document title comprehensive across the entire demeter. If there is no front matter, `data` will be missing, not just `data.title`.
1 parent 34de6bf commit 93b5d4e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

web/src/elements/Markdown.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ export class Markdown extends AKElement {
8787
const parsedContent = matter(this.md);
8888
const parsedHTML = this.converter.makeHtml(parsedContent.content);
8989
const replacers = [...this.defaultReplacers, ...this.replacers];
90-
this.docTitle = parsedContent.data["title"] ?? "";
90+
this.docTitle = parsedContent?.data?.title ?? "";
9191
this.docHtml = replacers.reduce(
9292
(html, replacer) => replacer(html, { path: this.meta }),
9393
parsedHTML,

0 commit comments

Comments
 (0)