From 28b735d4c1902d4a7f07c2bece74eb98107a046f Mon Sep 17 00:00:00 2001 From: Tobias Bieniek Date: Tue, 24 Oct 2023 11:43:40 +0200 Subject: [PATCH] Fix frontmatter assumption Using `---\n` assumes that all files use `\n` line endings, but one of our latest blog posts is using `\r\n` instead. This commit reverts the assumption about the frontmatter again to fix the rendering of that blog post. --- src/posts.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/posts.rs b/src/posts.rs index 66298a49e..3b330cfac 100644 --- a/src/posts.rs +++ b/src/posts.rs @@ -58,7 +58,7 @@ impl Post { // yaml headers.... we know the first four bytes of each file are "---\n" // so we need to find the end. we need the fours to adjust for those first bytes - let end_of_yaml = contents[4..].find("---\n").unwrap() + 4; + let end_of_yaml = contents[4..].find("---").unwrap() + 4; let yaml = &contents[..end_of_yaml]; let YamlHeader { author,