Announcement

Do not use the forums to submit bug reports, feature requests or patches, submit a New Ticket instead.

#1 2005-10-16 13:13:33

wikiwhacker
New member
Registered: 2005-08-19
Posts: 5

Toc

We've integrated Xinha to work with TWiki and would like to be able to offer the same 'Table of Contents' feature as TWiki provides by %TOC% variable.  Does anyone know how to do this?

Offline

#2 2005-10-17 19:35:44

wikiwhacker
New member
Registered: 2005-08-19
Posts: 5

Re: Toc

Found the problem: Just need to make sure the header tags are on separate lines in the HTML.  This will fix it:

   while ($line = <INPUT>)               
   { 

         $line =~ s/%TOC%/\n%TOC%\n/;         
         $line =~ s/<h1>/\n<h1>/;
         $line =~ s/<\/h1>/<\/h1>\n/;
         $line =~ s/<h2>/\n<h2>/;
         $line =~ s/<\/h2>/<\/h2>\n/;
         $line =~ s/<h3>/\n<h3>/;
         $line =~ s/<\/h3>/<\/h3>\n/;
         $line =~ s/<h4>/\n<h4>/;
         $line =~ s/<\/h4>/<\/h4>\n/;

         print OUTPUT $line;
   }

Last edited by wikiwhacker (2005-10-17 19:36:09)

Offline

Board footer

Powered by FluxBB