create new tag
, view all tags

Bug: Incorrect Whitespace Parsing in ToC

In a Table Of Contents, some formatting commands are only parsed correctly if a non-whitespace character is entered between the heading command ---+ and the formatting command.

Test case

this should be strong and in a code font

. but only if not the first non whitespace character

same for any rendering code?

nope, some codes, like strong emphasis are ignored in either case

*how* about *double strong* ?

Yup, *double strong* works, so there are actually two bugs here

Incorrect Whitespace Parsing in ToC, and:

Emphasis Ignored in Headings


here on Twiki.org

TWiki version:  
TWiki plugins:  
Server OS:  
Web server:  
Perl version:  
Client OS:  
Web Browser:  

-- MattWilkie - 04 Jul 2002

Follow up

Hmm, may be a correct fix would be to remove all formatting from the TOC bullets? Opinions?

-- PeterThoeny - 17 Jul 2002

I "vote" against that -- formatting (TWiki markup) should work wherever it is applied.

This brings to mind another point -- when an inline search is used to display the page name (topic) and summary, TWiki markup within the summary is not formatted. I believe it should be. If you need an example, I can create (or find) one.

-- RandyKramer - 17 Jul 2002

Is anybody working on this? I sure would like to see it fixed (and I don't have the time to work on it). An example of the problem I have is visible at http://twiki.ntp.org - look at the TOC for 5.4 (I think).

-- HarlanStenn - 27 Apr 2004

Fix record

I vote to keep formatting in TOC, too.

-- PeterMasiar - 18 Jul 2002

I fixed this bug. Formatting for bold and italic have already been filtered out. For consistency I added the filtering of fixed text as well. This fixes the bug. This bug happens only if you have fixed text at the very beginning or end of a heading.

BTW, **double strong** is not valid TWiki syntax and is not supported.

Fix in TWikiAlphaRelease and at TWiki.org. Fix you can easly apply to your installation:

*** TWiki.pm    27 Apr 2004 04:47:06 -0000      1.333
--- TWiki.pm    27 Apr 2004 07:03:30 -0000
*** 2386,2394 ****
                  for( $i=0 ; $i<$level ; $i++ ) {
                      $tabs = "\t$tabs";
!                 # Remove *bold* and _italic_ formatting
                  $line =~ s/(^|[\s\(])\*([^\s]+?|[^\s].*?[^\s])\*($|[\s\,\.\;\:\!\?\)])/$1$2$3/g;
                  $line =~ s/(^|[\s\(])_+([^\s]+?|[^\s].*?[^\s])_+($|[\s\,\.\;\:\!\?\)])/$1$2$3/g;
                  # Prevent WikiLinks
                  $line =~ s/\[\[.*?\]\[(.*?)\]\]/$1/g;  # '[[...][...]]'
                  $line =~ s/\[\[(.*?)\]\]/$1/ge;        # '[[...]]'
--- 2386,2395 ----
                  for( $i=0 ; $i<$level ; $i++ ) {
                      $tabs = "\t$tabs";
!                 # Remove *bold*, _italic_ and =fixed= formatting
                  $line =~ s/(^|[\s\(])\*([^\s]+?|[^\s].*?[^\s])\*($|[\s\,\.\;\:\!\?\)])/$1$2$3/g;
                  $line =~ s/(^|[\s\(])_+([^\s]+?|[^\s].*?[^\s])_+($|[\s\,\.\;\:\!\?\)])/$1$2$3/g;
+                 $line =~ s/(^|[\s\(])=+([^\s]+?|[^\s].*?[^\s])=+($|[\s\,\.\;\:\!\?\)])/$1$2$3/g;
                  # Prevent WikiLinks
                  $line =~ s/\[\[.*?\]\[(.*?)\]\]/$1/g;  # '[[...][...]]'
                  $line =~ s/\[\[(.*?)\]\]/$1/ge;        # '[[...]]'

-- PeterThoeny - 27 Apr 2004

Edit | Attach | Watch | Print version | History: r7 < r6 < r5 < r4 < r3 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r7 - 2004-04-27 - 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-2015 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.