File tree Expand file tree Collapse file tree 1 file changed +16
-7
lines changed Expand file tree Collapse file tree 1 file changed +16
-7
lines changed Original file line number Diff line number Diff line change 1313my  @chapters  = get_chapter_list();
1414my  $anchors   = get_anchors(@chapters );
1515
16+ #  start position of a link in the scratchpad
17+ my  $link_pos ;
18+ 
19+ sub  Pod ::PseudoPod::HTML::start_L
20+ {
21+     my  $self  = shift ;
22+     $link_pos  = length ($self -> {scratch });
23+ }
24+ 
1625sub  Pod ::PseudoPod::HTML::end_L
1726{
1827    my  $self  = shift ;
19-     if   ($self -> {scratch } =~  s / \b ( \w +)$ // ) 
20-     { 
21-          my   $link  =  $1 ;
22-          die   " Unknown link  $link \n "   unless   exists   $anchors -> { $link }; 
23-          $self -> {scratch } .=  ' <a href=" '  .  $anchors -> { $link }[0] .  " # $link \" > " 
24-                                          . $anchors -> {$link }[1 ] . ' </a> ' ; 
25-     } 
28+     my   $link  =  substr ($self -> {scratch },  $link_pos ); 
29+ 
30+     die   " Unknown link  $link \n "   unless   exists   $anchors -> { $link } ;
31+ 
32+     substr ( $self -> {scratch },  $link_pos ,  length ( $link ), 
33+              ' <a href=" '   . $anchors -> {$link }[0 ] . " # $link \" > " 
34+                          .  $anchors -> { $link }[1] .  ' </a> ' ); 
2635}
2736
2837for  my  $chapter  (@chapters )
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments