in reply to Error/Limitation: with anchor-links into functions like [doc://function#anchor]
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 ); }
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 ); }
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 ); }
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
|
|---|
| 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 |