From f35acfb2b9c84f990195cfc58b5039b35a57bf85 Mon Sep 17 00:00:00 2001 From: Alexander Lee Date: Thu, 16 Sep 2021 12:51:36 +0800 Subject: [PATCH] Fix: prevent truncating of page body (#299) --- utils/markdown-utils.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/markdown-utils.js b/utils/markdown-utils.js index 0157ce75b..a9dc54fef 100644 --- a/utils/markdown-utils.js +++ b/utils/markdown-utils.js @@ -2,9 +2,9 @@ const yaml = require("yaml") const retrieveDataFromMarkdown = (fileContent) => { // eslint-disable-next-line no-unused-vars - const [unused, encodedFrontMatter, pageContent] = fileContent.split("---") + const [unused, encodedFrontMatter, ...pageContent] = fileContent.split("---") const frontMatter = yaml.parse(encodedFrontMatter) - return { frontMatter, pageContent } + return { frontMatter, pageContent: pageContent.join("---") } } const convertDataToMarkdown = (frontMatter, pageContent) => {