Skip to main content

split

Function split 

Source
pub fn split(text: &str) -> Result<Option<(&str, &str)>, FrontMatterError>
Expand description

Splits text into the front matter block (the lines between the opening and closing ---, without the fences) and the body, without parsing the YAML. Returns Ok(None) if the first line is not --- (the whole text is the body), and Err(Unterminated) if no closing --- line follows. A trailing CR on the fence lines is ignored.