- my $mid = $node->{id};
- my $dst = $ctx->{dst};
- my $d = $ctx->{pct} ? ' [irrelevant] ' # search result
- : ' [not found] ';
- $d .= indent_for($level) . th_pfx($level);
- my $upfx = $ctx->{-upfx};
- my $m = PublicInbox::Hval->new_msgid($mid);
- my $href = $upfx . $m->{href} . '/';
- my $html = $m->as_html;
-
- my $mapping = $ctx->{mapping};
- my $map = $mapping->{$mid} if $mapping;
- if ($map) {
- my $id = id_compress($mid, 1);
- $map->[0] = $d . qq{<<a\nhref=#r$id>$html</a>>\n};
- $d .= qq{<<a\nhref="$href"\nid=r$id>$html</a>>\n};
- } else {
- $d .= qq{<<a\nhref="$href">$html</a>>\n};
- }
- $$dst .= $d;