fix front matter bug

This commit is contained in:
zyl 2024-11-07 16:53:58 -08:00
parent 790f25b829
commit 8419760fe1
Signed by: zyl
SSH key fingerprint: SHA256:uxxbSXbdroP/OnKBGnEDk5q7EKB2razvstC/KmzdXXs

View file

@ -16,7 +16,7 @@ where
/// Parses the given input for front matter.
pub fn parse(input: String) -> eyre::Result<Self> {
if input.starts_with("---\n") {
if let Some((frontmatter, content)) = input[3..].split_once("---\n") {
if let Some((frontmatter, content)) = input[3..].split_once("\n---\n") {
let data = serde_yml::from_str(frontmatter)?;
return Ok(Self {
content: content.to_string(),