Allow whitespace on the same line as closing front-matter chars

This commit is contained in:
Vincent Prouillet 2021-04-26 09:23:28 +02:00
parent e92e4f1003
commit 4f6528cf37

View file

@ -13,10 +13,10 @@ pub use section::SectionFrontMatter;
lazy_static! {
static ref TOML_RE: Regex =
Regex::new(r"^[[:space:]]*\+\+\+(\r?\n(?s).*?(?-s))\+\+\+(?:$|(?:\r?\n((?s).*(?-s))$))")
Regex::new(r"^[[:space:]]*\+\+\+(\r?\n(?s).*?(?-s))\+\+\+[[:space:]]*(?:$|(?:\r?\n((?s).*(?-s))$))")
.unwrap();
static ref YAML_RE: Regex =
Regex::new(r"^[[:space:]]*---(\r?\n(?s).*?(?-s))---(?:$|(?:\r?\n((?s).*(?-s))$))").unwrap();
Regex::new(r"^[[:space:]]*---(\r?\n(?s).*?(?-s))---[[:space:]]*(?:$|(?:\r?\n((?s).*(?-s))$))").unwrap();
}
pub enum RawFrontMatter<'a> {