@@ -377,6 +377,15 @@ sub find-definitions (:$pod, :$origin, :$min-level = -1, :$url) {
377
377
my @ definitions ; # [subkind, name]
378
378
my $ unambiguous = False ;
379
379
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
380
389
when : (" " , Pod ::FormattingCode $ , " " ) {
381
390
my $ fc := . [1 ];
382
391
proceed unless $ fc . type eq " X" ;
@@ -401,10 +410,14 @@ sub find-definitions (:$pod, :$origin, :$min-level = -1, :$url) {
401
410
# The C<Foo> infix
402
411
@ definitions = . [2 ]. words [0 ], . [1 ]. contents[0 ];
403
412
}
404
- when : (Str $ where /^ (\w+ ) \s$/ , Pod ::FormattingCode $ , " " ) {
413
+ when : (Str $ where /^ (\w+ ) \s$/ , Pod ::FormattingCode $) {
405
414
# infix C<Foo>
406
415
@ definitions = . [0 ]. words [0 ], . [1 ]. contents[0 ];
407
416
}
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
+ }
408
421
default { next }
409
422
}
410
423
0 commit comments