From fd6619320ecd3e622041c52e59cb46a97c90dd03 Mon Sep 17 00:00:00 2001 From: ElnuDev Date: Sat, 1 Jul 2023 12:44:23 -0700 Subject: [PATCH] Add fix for comrak bug not finding frontmatter --- src/models/challenge.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/models/challenge.rs b/src/models/challenge.rs index 4fcf2a6..573e3e7 100644 --- a/src/models/challenge.rs +++ b/src/models/challenge.rs @@ -31,8 +31,11 @@ impl Challenge { let arena = Arena::new(); let root = parse_document( &arena, - &fs::read_to_string(format!("content/challenges/{number}.md")) - .expect("Couldn't find challenge file"), + & (fs::read_to_string(format!("content/challenges/{number}.md")) + .expect("Couldn't find challenge file") + // comrak can't find frontmatter if there's only frontmatter and no newline at end + // TODO: Open issue in comrak + + "\n"), &options, ); if let Some(node) = root.children().next() {