From: Arthur C. <acl...@us...> - 2004-04-18 14:21:54
|
Update of /cvsroot/twiki/twiki/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20106 Modified Files: TWiki.pm Log Message: Updated makeAnchorHeading by removing redundant if/then; left 2 FIXME notes Index: TWiki.pm =================================================================== RCS file: /cvsroot/twiki/twiki/lib/TWiki.pm,v retrieving revision 1.324 retrieving revision 1.325 diff -C2 -r1.324 -r1.325 *** TWiki.pm 18 Apr 2004 14:09:30 -0000 1.324 --- TWiki.pm 18 Apr 2004 14:21:45 -0000 1.325 *************** *** 3443,3447 **** my( $theText, $theLevel ) = @_; ! # - Need to build '<nop><h1><a name="atext"> text </a></h1>' # type markup. # - Initial '<nop>' is needed to prevent subsequent matches. --- 3443,3447 ---- my( $theText, $theLevel ) = @_; ! # - Need to build '<nop><h1><a name="atext"></a> text </h1>' # type markup. # - Initial '<nop>' is needed to prevent subsequent matches. *************** *** 3462,3472 **** $hasAnchor = 1 if( $text =~ m/(^|[\s\(])($regex{wikiWordRegex})/ ); ! my $prefix = "<nop><h$theLevel><a name=\"$compatAnchorName\"></a> " . ! "<a name=\"$anchorName\"></a> "; ! if( $hasAnchor ) { ! $text = "$prefix $text </h$theLevel>"; ! } else { ! $text = "$prefix $text </h$theLevel>"; ! } return $text; --- 3462,3470 ---- $hasAnchor = 1 if( $text =~ m/(^|[\s\(])($regex{wikiWordRegex})/ ); ! # FIXME: $hasAnchor is not used ! # FIXME: What does $compatAnchorName do? Seems to be redundant: document this please ! my $headerprefix = "<nop><h$theLevel>"; ! my $anchorprefix = "<a name=\"$compatAnchorName\"></a>" . "<a name=\"$anchorName\"></a>"; ! $text = "$headerprefix$anchorprefix$text</h$theLevel>"; return $text; |