},
},
sub (/**/) {
- $self->structure(split '/', $_[1]);
+ $self->structure(map {
+ s{\\/}{/}g;
+ s{\\\\}{\\}g;
+ $_;
+ } split qr{(?<!\\)/}, $_[1]);
},
}
sub link_to {
my ($self, @to) = @_;
use HTML::Tags;
- my @link = map uri_escape(uri_escape($_)), @to;
+ my @link = map {
+ s{\\}{\\\\}g;
+ s{/}{\\/}g;
+ $_;
+ } @to;
my $link = join('/', @link, '');
my $to = $to[-1];
my $html = join '', HTML::Tags::to_html_string(
- <a href="${link}">, "Explore $to", </a>
+ <a href="./${link}">, "Explore $to", </a>
);
return \$html;
}
$target = $self->json->decode(scalar $target->all);
}
return $target unless @path;
- my $step = uri_unescape(uri_unescape( shift @path));
+ my $step = shift @path;
$self->descend($target->{$step}, @path);
}