Function parse_header

Source
pub fn parse_header<'a>(
    path: &'a mut Vec<Box<str>>,
    line: &str,
) -> Option<Result<PathChanges<'a>, SubheaderWithoutHeader>>
Expand description

Parses a header from a line of text.

§Arguments

  • path: A list of headers including the current header.
  • line: The line of text to parse.

§Returns

If the line is not a header, returns None. If the line is a valid header, returns the PathChanges which have to be used to update the path. If the header is a subheader without a corresponding header, an error is returned.