From: Robert 'phaylon' Sedlacek Date: Wed, 20 Jun 2012 02:36:00 +0000 (+0000) Subject: more sane intro-data structure link construction X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=8347d3a1f3cbea26ffec25a3cb8dadf44ba37ad3;hp=fd9adeae13d57af6de3e13a941b040d7acaf84f4;p=scpubgit%2FJSON-Tree-Viewer.git more sane intro-data structure link construction --- diff --git a/br.pl b/br.pl index 5adc85d..2c63bd1 100644 --- a/br.pl +++ b/br.pl @@ -204,10 +204,13 @@ sub render_table { sub render_el { my ($self, $whole, $key, $part) = @_; if (ref($part) eq 'ARRAY') { - if ($key eq 'entries') { - if (grep { ref($_) eq 'HASH' } @$part) { + if (grep { ref($_) eq 'HASH' } @$part) { + if ($whole->{key}) { + return $self->link_to($whole->{key}) + } elsif ($whole->{name}) { return $self->link_to($whole->{name}, $key); } + $part = '(complex)'; } return join(', ', @$part); }