diff --git a/core/lib/Foswiki/IncludeHandlers/doc.pm b/core/lib/Foswiki/IncludeHandlers/doc.pm index 079ecfb5e2..25ea73e913 100644 --- a/core/lib/Foswiki/IncludeHandlers/doc.pm +++ b/core/lib/Foswiki/IncludeHandlers/doc.pm @@ -177,7 +177,7 @@ sub INCLUDE { $secLine, { _package => -'^(?:---\++)(?:!!)?\h+(?(?i:package|class|role))\h+(?.+?)\h*?$', +'^(?:---\+)(?:!!)?\h+(?(?i:package|class|role))\h+(?.+?)\h*?$', _method => '^(---\++\h+(?Object|Static|Class)(?Method|Attribute)\h+(?(?_?).+?))\h*?$', }, @@ -229,6 +229,7 @@ sub INCLUDE { ) = @{ $ctxSection->{lexemes} } {qw(methodAccess methodType methodText methodPriv)}; + my $anchor; my $methodTextEncoded = Foswiki::entityEncode($methodText); if ( $publicOnly && $methodPriv ) { @@ -246,9 +247,14 @@ sub INCLUDE { $pluggable = $Foswiki::ExtManager::pluggables{$class} { $+{methodName} } ? "Pluggable " : ""; + + $anchor = "#" + . $methodAccess + . $methodType + . $+{methodName} . "\n"; } $pod .= -"\n$secDef =${pluggable}[[$methodAccess$methodType]]= ==$methodTextEncoded==\n"; +"\n$anchor$secDef =${pluggable}[[$methodAccess$methodType]]= ==$methodTextEncoded==\n"; } } else { # Just plain simple heading.