Bug: TOC incorrectly strips out links in headers
When there are mulitple links in a heading, the TOC generations incorrectly strips out the the links.
The problem is that the perl script does matching like
/\[\[.*\]\[(.*)?\]\]/$1/g
instead it should be:
/\[\[[^\]]*\]\[([^\]]*)?\]\]/$1/g
It was a very easy fix to make on our machine.
Test case
Environment
--
RussellOConnor - 26 Feb 2004
Follow up
Fix record
Thanks Russell for posting this. I fixed it by changing a greedy
.*
match to a non-greedy
.*?
one. Fix is in
TWikiAlphaRelease and at TWiki.org.
Change:
RCS file: /cvsroot/twiki/twiki/lib/TWiki.pm,v
retrieving revision 1.292
diff -r1.292 TWiki.pm
2362,2363c2362,2363
< $line =~ s/\[\[.*\]\[(.*?)\]\]/$1/g; # '[[...][...]]'
> $line =~ s/\[\[(.*?)\]\]/$1/ge; # '[[...]]'
---
> $line =~ s/\[\[.*?\]\[(.*?)\]\]/$1/g; # '[[...][...]]'
> $line =~ s/\[\[(.*?)\]\]/$1/ge; # '[[...]]'
--
PeterThoeny - 29 Feb 2004