From ee29b9d5f6b509cd3c61972d50655d6f82157f1a Mon Sep 17 00:00:00 2001 From: Michal Budzynski Date: Tue, 1 Aug 2017 13:16:47 +0200 Subject: [PATCH] added clone derives and made the separating space mandatory in links with paths --- src/preprocess/links.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/preprocess/links.rs b/src/preprocess/links.rs index a5b3d3ee..2eef9b38 100644 --- a/src/preprocess/links.rs +++ b/src/preprocess/links.rs @@ -22,14 +22,14 @@ pub fn replace_all>(s: &str, path: P) -> Result { Ok(replaced) } -#[derive(PartialOrd, PartialEq, Debug)] +#[derive(PartialOrd, PartialEq, Debug, Clone)] enum LinkType<'a> { Escaped, Include(PathBuf), Playpen(PathBuf, Vec<&'a str>), } -#[derive(PartialOrd, PartialEq, Debug)] +#[derive(PartialOrd, PartialEq, Debug, Clone)] struct Link<'a> { start_index: usize, end_index: usize, @@ -110,7 +110,7 @@ fn find_links(contents: &str) -> LinkIter { | # or \{\{\s* # link opening parens and whitespace \#([a-zA-Z0-9]+) # link type - \s* # separating whitespace + \s+ # separating whitespace ([a-zA-Z0-9\s_.\-:/\\]+) # link target path and space separated properties \s*\}\} # whitespace and link closing parens ").unwrap();