summaryrefslogtreecommitdiffhomepage
path: root/vhosts/blog/nuldoc-src/djot/parse.ts
diff options
context:
space:
mode:
Diffstat (limited to 'vhosts/blog/nuldoc-src/djot/parse.ts')
-rw-r--r--vhosts/blog/nuldoc-src/djot/parse.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/vhosts/blog/nuldoc-src/djot/parse.ts b/vhosts/blog/nuldoc-src/djot/parse.ts
index 884ab154..c79a6708 100644
--- a/vhosts/blog/nuldoc-src/djot/parse.ts
+++ b/vhosts/blog/nuldoc-src/djot/parse.ts
@@ -15,9 +15,9 @@ export async function parseDjotFile(
): Promise<Document> {
try {
const fileContent = await Deno.readTextFile(filePath);
- const parts = fileContent.split(/^---$/m);
- const meta = parseMetadata(parts[1]);
- const root = parseDjot(parts[2]);
+ const [, frontmatter, ...rest] = fileContent.split(/^---$/m);
+ const meta = parseMetadata(frontmatter);
+ const root = parseDjot(rest.join("\n"));
const doc = createNewDocumentFromDjotDocument(root, meta, filePath, config);
return await toHtml(doc);
} catch (e) {