Skip to content

Commit 357ed1b

Browse files
authored
Fix frontmatter assumption (#1158)
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.
1 parent 2b37a2d commit 357ed1b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/posts.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ impl Post {
5858

5959
// yaml headers.... we know the first four bytes of each file are "---\n"
6060
// so we need to find the end. we need the fours to adjust for those first bytes
61-
let end_of_yaml = contents[4..].find("---\n").unwrap() + 4;
61+
let end_of_yaml = contents[4..].find("---").unwrap() + 4;
6262
let yaml = &contents[..end_of_yaml];
6363
let YamlHeader {
6464
author,

0 commit comments

Comments
 (0)