create new tag
, view all tags

Bug: TOC With Parameters Does Not Obey STOPINCLUDE Statement.

I have several web pages in various states of construction that form sections of a single document. Each of these pages is broken into a section with final text and a section of notes that will eventually be incorporated into the final text. The breakpoint is specified with a STOPINCLUDE.

If I use just a TOC in the main document, items following the STOPINCLUDE statement are not placed in the TOC. If I use TOC{"page"} to refer to the individual pages, the headings following the STOPINCLUDE are placed into the TOC.

Test case

The composite document contains a plain TOC and two includes:


This is a parameterized TOC pointing to the composite document:

This is two parameterized TOCs pointing to the component documents:

The two tables of contents above and the TOC in TocTestCompositeDocument should probably all be identical for the sake of consistancy, although I can see situations (and argue the case) where one might like to maintain the current behaviour.

I agree with this -- I can imagine that the two different behaviors might be useful at times. Note also that there is an outstanding issue with respect to TOCs -- the links do not distinguish between two different headings with the same name. Perhaps when that issue is dealt with this issue might be dealt with (somehow) at the same time. -- RandyKramer - 05 Feb 2002


TWiki version: TWiki20011201
TWiki plugins: Default, Empty, Interwiki
Server OS: Redhat Linux 7.2
Web server: Apache 1.3.22
Perl version: v5.6.0
Client OS: Redhat Linux 7.2
Web Browser: Netscape Communicator 4.78

-- JohnAltstadt - 03 Feb 2002

Fix record

Index: TWiki.pm
--- TWiki.pm    (revision 1672)
+++ TWiki.pm    (working copy)
@@ -2396,8 +2396,10 @@
         if ( ! &TWiki::Store::topicExists( $web, $topicname ) ) {
             return showError( "TOC: Cannot find topic \"$web.$topicname\"" );
-        @list = split( /\n/, handleCommonTags( 
-            &TWiki::Store::readWebTopic( $web, $topicname ), $topicname, $web ) );
+       my $t = TWiki::Store::readWebTopic( $web, $topicname );
+       $t =~ s/.*?%STARTINCLUDE%//s;
+       $t =~ s/%STOPINCLUDE%.*//s;
+        @list = split( /\n/, handleCommonTags( $t, $topicname, $web ) );
     @list = grep { /(<\/?pre>)|($regex{headerPatternDa})|($regex{headerPatternSp})|($regex{headerPatternHt})/ } @list;

-- WillNorris - 04 Aug

Thanks Will. That was an easy one, quick to incorporate and also quick to verify smile


-- PeterThoeny - 04 Aug 2004

Edit | Attach | Watch | Print version | History: r6 < r5 < r4 < r3 < r2 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r6 - 2004-08-04 - PeterThoeny
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2018 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.