diff --git a/src/hdmf/container.py b/src/hdmf/container.py index 614fbbccd..889fcf490 100644 --- a/src/hdmf/container.py +++ b/src/hdmf/container.py @@ -626,7 +626,10 @@ def _generate_html_repr(self, fields, level=0, access_code="", is_field=False): if isinstance(fields, dict): for key, value in fields.items(): current_access_code = f"{access_code}.{key}" if is_field else f"{access_code}['{key}']" - html_repr += self._generate_field_html(key, value, level, current_access_code) + if hasattr(value, '_generate_field_html'): + html_repr += value._generate_field_html(key, value, level, current_access_code) + else: + html_repr += self._generate_field_html(key, value, level, current_access_code) elif isinstance(fields, list): for index, item in enumerate(fields): access_code += f'[{index}]'