From 4f6528cf37bc325f6b50caddb61f479b5ebd71b4 Mon Sep 17 00:00:00 2001 From: Vincent Prouillet Date: Mon, 26 Apr 2021 09:23:28 +0200 Subject: [PATCH] Allow whitespace on the same line as closing front-matter chars --- components/front_matter/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/front_matter/src/lib.rs b/components/front_matter/src/lib.rs index a8e46127..e343e649 100644 --- a/components/front_matter/src/lib.rs +++ b/components/front_matter/src/lib.rs @@ -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> {