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