--- /Users/arthurclemens/Applications/FreeBSD/TWiki/TWiki20030201 Folder/lib/TWiki-org.pm Sun Feb 2 01:55:21 2003 +++ /Users/arthurclemens/Applications/FreeBSD/TWiki/TWiki20030201 Folder/lib/TWiki.pm Fri Aug 29 00:27:50 2003 @@ -1569,7 +1569,19 @@ # get the depth limit attribute my $depth = extractNameValuePair( $_[3], "depth" ) || 6; - my $result = ""; + my $result = ""; + # Start surrounding table + if ("$topicname" eq "$_[1]") { + # TO DO: should pass TOC heading in parameter + # where "Contents:" would be the default variable + $result = "
Contents:<\/b>
"; + } else { + # ... then this would not be necessary + # (used when TOC is called from another topic) + my $t = &handleNormalSpacedTopic($topicname); + $result = "
$t<\/b>
"; + } + my $line = ""; my $level = ""; my @list = (); @@ -1637,18 +1649,22 @@ $line =~ s/([\s\(])($webNameRegex)\.($wikiWordRegex)/$1$3/g; # 'Web.TopicName' $line =~ s/([\s\(])($wikiWordRegex)/$1$2/g; # 'TopicName' $line =~ s/([\s\(])($abbrevRegex)/$1$2/g; # 'TLA' + # create linked bullet item $line = "$tabs* $line"; $result .= "\n$line"; } } } + if( $result ) { - if( $highest > 1 ) { + if( $highest > 1 ) { # left shift TOC $highest--; $result =~ s/^\t{$highest}//gm; } + # close surrounding table + $result .= "<\/td><\/tr><\/table>"; return $result; } else {