diff --git a/src/renderer/renderer.rs b/src/renderer/renderer.rs index cd84440..8812dce 100644 --- a/src/renderer/renderer.rs +++ b/src/renderer/renderer.rs @@ -528,21 +528,39 @@ impl<'a> DustRenderer<'a> { None, ¶meterized_block.explicit_context, ); + let new_breadcrumbs_ref = new_breadcrumbs.as_ref().unwrap_or(breadcrumbs); match ¶meterized_block.contents { None => return Ok("".to_owned()), Some(body) => { - let comparison_helpers = body.elements.iter().filter_map(|te| match te { - TemplateElement::TETag(dt) => match dt { - DustTag::DTHelperEquals(_) - | DustTag::DTHelperNotEquals(_) - | DustTag::DTHelperGreaterThan(_) - | DustTag::DTHelperLessThan(_) - | DustTag::DTHelperGreaterThanOrEquals(_) - | DustTag::DTHelperLessThanOrEquals(_) => Some(dt), + let param_map = ParametersContext::new( + self, + breadcrumbs, + ¶meterized_block.params, + None, + ); + let are_any_checks_true = body + .elements + .iter() + .filter_map(|te| match te { + TemplateElement::TETag(dt) => match dt { + DustTag::DTHelperEquals(_) + | DustTag::DTHelperNotEquals(_) + | DustTag::DTHelperGreaterThan(_) + | DustTag::DTHelperLessThan(_) + | DustTag::DTHelperGreaterThanOrEquals(_) + | DustTag::DTHelperLessThanOrEquals(_) => Some(dt), + _ => None, + }, _ => None, - }, - _ => None, - }); + }) + .map(|dt| { + self.perform_comparison_check( + dt, + new_breadcrumbs_ref, + Some(¶m_map), + ) + }) + .any(|check_result| check_result.unwrap_or(false)); } } }