Implement the size helper but it has a bug somewhere.

This commit is contained in:
Tom Alexander 2020-06-14 13:16:52 -04:00
parent a6c22417e5
commit 44d54c86d2
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE

View File

@ -723,8 +723,21 @@ impl<'a> DustRenderer<'a> {
}
}
DustTag::DTHelperSize(parameterized_block) => {
//todo
todo!()
let param_map =
ParametersContext::new(self, breadcrumbs, &parameterized_block.params, None);
let value = self.tap(breadcrumbs, &param_map, "key");
let value_ce = value.as_ref().map(|maybe_ice| {
maybe_ice
.as_ref()
.map(|ice| ice.get_context_element_reference())
.map(|ce| ce.get_size())
});
match value_ce {
None | Some(Err(_)) | Some(Ok(None)) => return Ok("".to_owned()),
Some(Ok(Some(ce_size))) => {
return ce_size.get_context_element_reference().render(&Vec::new())
}
}
}
DustTag::DTHelperContextDump(parameterized_block) => {
//todo