Bug: Headers with WikiWords Render Incorrectly in Dakar
Headers with
WikiWords don't render correctly in Dakar. This behavior seems to have appeared before the
MultiLevelWikiWebs merge.
Test case
This code:
---+++ WebPreferences will break this header
Currently renders like this:
WebPreferences will break th"> WebPreferences will break this header
Environment
--
PeterNixon - 05 Jul 2005
Impact and Available Solutions
Follow up
Looks like
WikiWords are getting expanded inside header markers (the <a name="header text"></a> thingy):
---+++ WebPreferences will break this header
produces this:
<h3><a name="<a href="http://g5/dakar/bin/view/Sandbox/Test2/WebPreferences
class="twikiLink">WebPreferences</a> will break th"></a> <a
href="http://g5/dakar/bin/view/Sandbox/Test2/WebPreferences"
class="twikiLink">WebPreferences</a> will break this header </h3>
--
PeterNixon - 05 Jul 2005
Thanks Peter. Looks like TOC is proken on Cairo too, judging from the TOC at the top of the page.
BTW, could you report problems to the
Bugs web
rather than here, please? It saves them getting lost. Thx
--
CrawfordCurrie - 05 Jul 2005
I think it's just picking up the H3 tag I used in the test case. I'll re-file in the bugs web.
--
PeterNixon - 05 Jul 2005
Double-bracket links are not being filtered from the anchor name, and are subsequently rendered. Removing the double-brackets from the anchorName seems to fix the problem, and didn't affect TOC functionality in the TestCases web. Here's a patch for Render.pm (already applied to the DEVELOP branch):
Index: lib/TWiki/Render.pm
===================================================================
--- lib/TWiki/Render.pm (revision 4518)
+++ lib/TWiki/Render.pm (working copy)
@@ -353,6 +353,9 @@
return substr($anchorName, 1);
}
+ $anchorName =~ s/\s*\[\s*\[.*?\]\s*\[(.*?)\]\s*\]/$1/og; # remove double bracket link
+ $anchorName =~ s/\s*\[\s*\[\s*(.*?)\s*\]\s*\]/$1/og; # remove double bracket link
+
if ( $compatibilityMode ) {
# remove leading/trailing underscores first, allowing them to be
# reintroduced
--
PeterNixon - 06 Jul 2005
Fix record
These patches, as well as the patches for
HeaderAnchorNameWrongWhenLinkInHeader, have been applied to the DEVELOP branch.
Discussion
Have they been merged to
trunk (resp. Cairo = Core) too? Merges to DEVELOP are just
ReadyForMerge. Some people take this difference very seriously (not me!

)
--
FranzJosefSilli - 08 Jul 2005
Whoops, yes
ReadyForMerge is what I meant. Here's a patch against
trunk version
4553 if anyone wants it:
--
PeterNixon - 09 Jul 2005