mirror of
https://github.com/rust-lang/mdBook
synced 2024-12-13 14:22:35 +00:00
Warn when preproc order references unknown preprocs
This commit is contained in:
parent
d8ad68c947
commit
6b790b83ec
1 changed files with 15 additions and 2 deletions
|
@ -416,7 +416,14 @@ fn determine_preprocessors(config: &Config) -> Result<Vec<Box<dyn Preprocessor>>
|
|||
))
|
||||
})?;
|
||||
|
||||
if exists(after) {
|
||||
if !exists(after) {
|
||||
// Only warn so that preprocessors can be toggled on and off (e.g. for
|
||||
// troubleshooting) without having to worry about order too much.
|
||||
warn!(
|
||||
"preprocessor.{}.after contains \"{}\", which was not found",
|
||||
name, after
|
||||
);
|
||||
} else {
|
||||
preprocessor_names.add_dependency(name, after);
|
||||
}
|
||||
}
|
||||
|
@ -437,7 +444,13 @@ fn determine_preprocessors(config: &Config) -> Result<Vec<Box<dyn Preprocessor>>
|
|||
))
|
||||
})?;
|
||||
|
||||
if exists(before) {
|
||||
if !exists(before) {
|
||||
// See equivalent warning above for rationale
|
||||
warn!(
|
||||
"preprocessor.{}.before contains \"{}\", which was not found",
|
||||
name, before
|
||||
);
|
||||
} else {
|
||||
preprocessor_names.add_dependency(before, name);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue