diff --git a/src/preprocessor.rs b/src/preprocessor.rs index a198469..188a3ff 100644 --- a/src/preprocessor.rs +++ b/src/preprocessor.rs @@ -79,7 +79,7 @@ impl Graphviz { for item in mem::take(items) { item_futures.push(async { match item { - BookItem::Chapter(chapter) if chapter.path.is_some() => { + BookItem::Chapter(chapter) => { self.process_chapter(chapter).await.map(BookItem::Chapter) } item => { @@ -103,6 +103,10 @@ impl Graphviz { // make sure to process our chapter sub-items self.process_sub_items(&mut chapter.sub_items).await?; + if chapter.path.is_none() { + return Ok(chapter); + } + // assume we've already filtered out all the draft chapters let mut chapter_path = self.src_dir.join(chapter.path.as_ref().unwrap()); // remove the chapter filename