diff --git a/src/preprocess/links.rs b/src/preprocess/links.rs index 757887f1..4fe06a9d 100644 --- a/src/preprocess/links.rs +++ b/src/preprocess/links.rs @@ -139,6 +139,7 @@ enum LinkType<'a> { RustdocInclude(PathBuf, RangeOrAnchor), Title(&'a str), Template(PathBuf, HashMap), + Title(&'a str), } #[derive(PartialEq, Debug, Clone)] @@ -211,6 +212,7 @@ impl<'a> LinkType<'a> { LinkType::RustdocInclude(p, _) => Some(return_relative_path(base, &p)), LinkType::Title(_) => None, LinkType::Template(p, _) => Some(return_relative_path(base, &p)), + LinkType::Title(_) => None, } } } @@ -401,6 +403,7 @@ impl<'a> Link<'a> { LinkType::Title(title) => { *chapter_title = title.to_owned(); Ok(String::new()) + } LinkType::Template(ref pat, ref dict) => { let target = base.join(pat); fs::read_to_string(&target) @@ -423,6 +426,11 @@ impl<'a> Link<'a> { ) }) } + + LinkType::Title(title) => { + *chapter_title = title.to_owned(); + Ok(String::new()) + } } } }