Skip to main content

extract_frontmatter

Function extract_frontmatter 

Source
pub(crate) fn extract_frontmatter(source: &str) -> Option<&str>
Expand description

Extract the YAML frontmatter block from a .local.md file.

Tolerates a leading BOM and CRLF line endings: the file is hand-edited on Windows, where both are routine, and a settings file that silently stops being read because an editor added a BOM is a miserable thing to debug.