diff --git a/rslib/src/template.rs b/rslib/src/template.rs index 5b92f04a6..39a59d9fc 100644 --- a/rslib/src/template.rs +++ b/rslib/src/template.rs @@ -741,9 +741,9 @@ impl ParsedTemplate { } pub(crate) fn contains_field_replacement(&self) -> bool { - self.0 - .iter() - .any(|node| matches!(node, ParsedNode::Replacement { key: _, filters: _ })) + let mut set = HashSet::new(); + find_field_references(&self.0, &mut set, false, false); + !set.is_empty() } pub(crate) fn add_missing_field_replacement(&mut self, field_name: &str, is_cloze: bool) {