Do not add a fallback field reference if front side contains conditionals (#2859)
* Do not add a fallback field ref if front contains conditionals * Ensure field reference when there are only conditionals
This commit is contained in:
parent
987a46978b
commit
27b2bce604
@ -741,9 +741,9 @@ impl ParsedTemplate {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn contains_field_replacement(&self) -> bool {
|
pub(crate) fn contains_field_replacement(&self) -> bool {
|
||||||
self.0
|
let mut set = HashSet::new();
|
||||||
.iter()
|
find_field_references(&self.0, &mut set, false, false);
|
||||||
.any(|node| matches!(node, ParsedNode::Replacement { key: _, filters: _ }))
|
!set.is_empty()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn add_missing_field_replacement(&mut self, field_name: &str, is_cloze: bool) {
|
pub(crate) fn add_missing_field_replacement(&mut self, field_name: &str, is_cloze: bool) {
|
||||||
|
Loading…
Reference in New Issue
Block a user