is_last_input compares against len(templates.custom.items()) - 1, but you continue past inputs that lack template_type, so the ASCII tree may render └ on non-final printed items. Compute the filtered inputs list first.
is_last_input compares against len(templates.custom.items()) - 1, but you continue past inputs that lack template_type, so the ASCII tree may render └ on non-final printed items. Compute the filtered inputs list first.