Tags:
archive_me1Add my vote for this tag create new tag
, view all tags

Bug: Heading containing & without spaces surrounding it can't be jumped to using TOC.

Test case

Links in the TOC above for some of following headings are incorrect:

C&D&Partners

Without&spaces

Another & in heading.

Surrounded with spaces it's OK.

At the end it's OK: &.

Environment

TWiki version: TWikiBetaRelease
TWiki plugins: plugins currently installed at twiki.org
Server OS:  
Web server:  
Perl version:  
Client OS:  
Web Browser:  

-- JurajVariny - 18 May 2004

Follow up

If you look at the source, you will notice that the anchor links are encoded in 2 separate ways:

In TOC: a href="#C_D_Partners"

with heading: a name="CDPartners"

-- ArthurClemens - 18 May 2004

It seems that handleToc in TWikiDotPm and makeAnchorName in RenderDotPm use different schemes to remove illegal characters. Shouldn't handleToc be moved into RenderDotPm?

-- ArthurClemens - 18 May 2004

Fix record

Fix is in SVN:

Index: Render.pm
===================================================================
--- Render.pm   (revision 1569)
+++ Render.pm   (working copy)
@@ -496,6 +496,7 @@
     }
     $anchorName =~ s/<\w[^>]*>//gi;         # remove HTML tags
     $anchorName =~ s/\&\#?[a-zA-Z0-9]*;//g; # remove HTML entities
+    $anchorName =~ s/\&//g;                 # remove &
     $anchorName =~ s/^(.+?)\s*$regex{headerPatternNoTOC}.*/$1/o; # filter TOC excludes if not at beginning
     $anchorName =~ s/$regex{headerPatternNoTOC}//o; # filter '!!', '%NOTOC%'
     # FIXME: More efficient to match with '+' on next line:

-- PeterThoeny - 11 Jul 2004

Topic revision: r5 - 2004-07-16 - PeterThoeny
 
Twitter Delicious Facebook Digg Google Bookmarks E-mail LinkedIn Reddit StumbleUpon    
  • Download TWiki
TWiki logo Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2012 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.