Skip to content

Commit d7a132a

Browse files
Made sure we only emit NotInSummary errors for markdown files
1 parent da2f23d commit d7a132a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/validate.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use linkcheck::{
88
};
99
use std::{
1010
collections::HashMap,
11-
ffi::OsString,
11+
ffi::{OsStr, OsString},
1212
fmt::{self, Display, Formatter},
1313
path::{Component, Path, PathBuf},
1414
sync::Mutex,
@@ -85,8 +85,10 @@ fn ensure_included_in_book(
8585
let part_of_the_book = resolved_link.starts_with(&src_dir);
8686
let was_included_in_summary =
8787
file_names.iter().any(|name| resolved_link.ends_with(name));
88+
let ext = resolved_link.extension();
89+
let is_marhdown = ext == Some(OsStr::new("md"));
8890

89-
if !part_of_the_book || was_included_in_summary {
91+
if !part_of_the_book || was_included_in_summary || !is_marhdown {
9092
Ok(())
9193
} else {
9294
use std::io::{Error, ErrorKind};

0 commit comments

Comments
 (0)