Skip to content

Commit eafa0de

Browse files
committed
preparing for removal of extra ""
Putting some redundant when statements to catch the new .contents format when that happens
1 parent cc397c0 commit eafa0de

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

htmlify.p6

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,15 @@ sub find-definitions (:$pod, :$origin, :$min-level = -1, :$url) {
377377
my @definitions; # [subkind, name]
378378
my $unambiguous = False;
379379
given @header {
380+
when :(Pod::FormattingCode $) {
381+
my $fc := .[0];
382+
proceed unless $fc.type eq "X";
383+
@definitions = $fc.meta[0].flat;
384+
# set default name if none provide so X<if|control> gets name 'if'
385+
@definitions[1] = $fc.contents[0] if @definitions == 1;
386+
$unambiguous = True;
387+
}
388+
# XXX: Remove when extra "" have been purged
380389
when :("", Pod::FormattingCode $, "") {
381390
my $fc := .[1];
382391
proceed unless $fc.type eq "X";
@@ -401,10 +410,14 @@ sub find-definitions (:$pod, :$origin, :$min-level = -1, :$url) {
401410
# The C<Foo> infix
402411
@definitions = .[2].words[0], .[1].contents[0];
403412
}
404-
when :(Str $ where /^(\w+) \s$/, Pod::FormattingCode $, "") {
413+
when :(Str $ where /^(\w+) \s$/, Pod::FormattingCode $) {
405414
# infix C<Foo>
406415
@definitions = .[0].words[0], .[1].contents[0];
407416
}
417+
# XXX: Remove when extra "" have been purged
418+
when :(Str $ where /^(\w+) \s$/, Pod::FormattingCode $, "") {
419+
@definitions = .[0].words[0], .[1].contents[0];
420+
}
408421
default { next }
409422
}
410423

0 commit comments

Comments
 (0)