From 851e6f2ffd50fbce30d39fff4bbab36f4b0aec4f Mon Sep 17 00:00:00 2001 From: gh0sTedBuddy Date: Mon, 1 Apr 2024 23:16:08 +0100 Subject: [PATCH] fix(Markdown) ignore front matter if not first line --- src/Views/Markdown.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Views/Markdown.js b/src/Views/Markdown.js index 3800754..bece9e3 100644 --- a/src/Views/Markdown.js +++ b/src/Views/Markdown.js @@ -91,6 +91,13 @@ export default class MarkdownEngine { return value; } + if(content.substring(0,3) != '```') { + return { + metadata: {}, + content + } + } + let lines = content.split('\n'); let isFrontMatter = false; const variables = {}; @@ -129,7 +136,7 @@ export default class MarkdownEngine { return { metadata: variables, - content: lines.join("\n"), + content: lines.join("\n") || content, }; }