Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Error/Limitation: with anchor-links into functions like [doc://function#anchor] (updated)

by LanX (Saint)
on Jun 24, 2019 at 13:58 UTC ( [id://11101812]=note: print w/replies, xml ) Need Help??


in reply to Error/Limitation: with anchor-links into functions like [doc://function#anchor]

seems to be done in one of those two hashes holding callbacks to handle [doc://...] links
update

ironically it's the first one

return( "http://perldoc.perl.org/", 'Perl documentation' ) unless $suf +fix; my $func= getVars(getNode('perl keyword list setting','setting')); if( $func->{$suffix} ) { "http://perldoc.perl.org/functions/$escsuffix.html" } elsif( $suffix =~ /^[\$\@%]/ ) { "http://perldoc.perl.org/perlvar.html#$escsuffix" } else { my ( $page, $anchor ) = split '#', $suffix, 2; my ( $uri, $title ) = ( "http://perldoc.perl.org/" ); $uri .= join '/', map $q->escape( $_ ), split /::/, $page; $uri .= '.html'; if( defined $anchor ) { $uri .= '#' . $q->escape( $anchor ); ( $title = $q->escapeHTML( $q->unescape( $anchor ) ) ) =~ y/-/ +/; } ( $uri, ( $title ) x!! defined $title ); }

update

a fix might look like (untested)

return( "http://perldoc.perl.org/", 'Perl documentation' ) unless $suf +fix; if( $suffix =~ /^[\$\@%]/ ) { "http://perldoc.perl.org/perlvar.html#$escsuffix" } else { my ( $page, $anchor ) = split '#', $suffix, 2; my ( $uri, $title ) = ( "http://perldoc.perl.org/" ); my $func= getVars(getNode('perl keyword list setting','setting')); $uri .= "functions/$page" if( $func->{$page} ); # handle functions $uri .= join '/', map $q->escape( $_ ), split /::/, $page; $uri .= '.html'; if( defined $anchor ) { $uri .= '#' . $q->escape( $anchor ); ( $title = $q->escapeHTML( $q->unescape( $anchor ) ) ) =~ y/-/ +/; } ( $uri, ( $title ) x!! defined $title ); }

update
maybe better like this
return( "http://perldoc.perl.org/", 'Perl documentation' ) unless $suf +fix; if( $suffix =~ /^[\$\@%]/ ) { "http://perldoc.perl.org/perlvar.html#$escsuffix" } else { my ( $page, $anchor ) = split '#', $suffix, 2; my ( $uri, $title ) = ( "http://perldoc.perl.org/" ); my $func= getVars(getNode('perl keyword list setting','setting')); if( $func->{$page} ) { # LanX: handle functions $uri .= "functions/$page"; # ??? do functions need to escaped? } else { # LanX: handle core modules and pragmas $uri .= join '/', map $q->escape( $_ ), split /::/, $page; } $uri .= '.html'; if( defined $anchor ) { $uri .= '#' . $q->escape( $anchor ); ( $title = $q->escapeHTML( $q->unescape( $anchor ) ) ) =~ y/-/ +/; } ( $uri, ( $title ) x!! defined $title ); }

update
regarding  $uri .= "functions/$page";  # ??? do functions need to escaped?

none of the functions listed in perl keyword list setting needs to be escaped. even -X works fine

comments???

Is there a test suite?

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery FootballPerl is like chess, only without the dice

  • Comment on Re: Error/Limitation: with anchor-links into functions like [doc://function#anchor] (updated)
  • Select or Download Code

Replies are listed 'Best First'.
Re^2: Error/Limitation: with anchor-links into functions like [doc://function#anchor] (updated)
by jdporter (Paladin) on Jun 26, 2019 at 15:14 UTC
    ironically it's the first one

    FYI, in general (though I think there is an exception, maybe two), infrastructure nodes with names like "new ..." are not operational; they were testbeds for radical changes; once fully tested, their code was migrated into the regular code node.

    One way to tell (for... 90% sure) is to search code for the node name,and see if it's used. You'll find that new handlelinks settings isn't used, whereas handlelinks settings is referenced quite a bit.

    I reckon we are the only monastery ever to have a dungeon stuffed with 16,000 zombies.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11101812]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2024-04-24 04:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found