in reply to Re^2: creating links to an =item in the same page via pod2html
in thread creating links to an =item in the same page via pod2html
I'm also not seeing why the quotes in the second case are optional. Without garantees, my final patch would look like this:} elsif ($par=~m{"(.*)"}) { ($page,$section)=('',$1); #In this case, it looks to me # that the pod author forgot the initial / but is # trying to link to a section in corrent page # (quoted name).
But, maybe I'm missing something that Tom Christiansen found. I don't know.--- Html.pm 2005-07-01 14:48:23.000000000 +0100 +++ Html.pm.new 2005-07-01 23:07:35.000000000 +0100 @@ -1549,15 +1549,20 @@ my( $page, $section, $ident ); # check for link patterns - if( $par =~ m{^([^/]+?)/(?!")(.*?)$} ){ # name/ident + if( $par =~ m{^([^/]+)?/(?!")(.*?)$} ){ # name/ident # we've got a name/ident (no quotes) ( $page, $ident ) = ( $1, $2 ); ### print STDERR "--> L<$par> to page $page, ident $ident +\n"; - } elsif( $par =~ m{^(.*?)/"?(.*?)"?$} ){ # [name]/"section" - # even though this should be a "section", we go for ident + first - ( $page, $ident ) = ( $1, $2 ); + } elsif( $par =~ m{^(.*)?/"(.*?)"$} ){ # [name]/"section" + # we've got a name/"section" + ( $page, $section ) = ( $1, $2 ); ### print STDERR "--> L<$par> to page $page, section $sec +tion\n"; + + } elsif ( $par =~ m{^"(.*?)"$} ){ # "section" + # we've got a section without a pagename + ( $page, $section ) = ('',$1); + ### print STDERR "--> L<$par> to void page, section $sect +ion\n"; } elsif( $par =~ /\s/ ){ # this must be a section with missin +g quotes ( $page, $section ) = ( '', $par );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: creating links to an =item in the same page via pod2html
by ysth (Canon) on Jul 01, 2005 at 23:13 UTC | |
by themage (Friar) on Jul 02, 2005 at 12:23 UTC |