Skip to content

Commit

Permalink
Merge pull request #261 from LLFourn/master
Browse files Browse the repository at this point in the history
preparing for removal of extra ""
  • Loading branch information
moritz committed Jan 3, 2016
2 parents b874994 + eafa0de commit f6ac8ca
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion htmlify.p6
Expand Up @@ -378,6 +378,15 @@ sub find-definitions (:$pod, :$origin, :$min-level = -1, :$url) {
my @definitions; # [subkind, name]
my $unambiguous = False;
given @header {
when :(Pod::FormattingCode $) {
my $fc := .[0];
proceed unless $fc.type eq "X";
@definitions = $fc.meta[0].flat;
# set default name if none provide so X<if|control> gets name 'if'
@definitions[1] = $fc.contents[0] if @definitions == 1;
$unambiguous = True;
}
# XXX: Remove when extra "" have been purged
when :("", Pod::FormattingCode $, "") {
my $fc := .[1];
proceed unless $fc.type eq "X";
Expand All @@ -402,10 +411,14 @@ sub find-definitions (:$pod, :$origin, :$min-level = -1, :$url) {
# The C<Foo> infix
@definitions = .[2].words[0], .[1].contents[0];
}
when :(Str $ where /^(\w+) \s$/, Pod::FormattingCode $, "") {
when :(Str $ where /^(\w+) \s$/, Pod::FormattingCode $) {
# infix C<Foo>
@definitions = .[0].words[0], .[1].contents[0];
}
# XXX: Remove when extra "" have been purged
when :(Str $ where /^(\w+) \s$/, Pod::FormattingCode $, "") {
@definitions = .[0].words[0], .[1].contents[0];
}
default { next }
}

Expand Down

0 comments on commit f6ac8ca

Please sign in to comment.