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:
TocTestCompositeDocument
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
Environment
| 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
In
SVN.
--
PeterThoeny - 04 Aug 2004