(Copied from TWiki:Codev.HeaderRenderingWithWikiWordsBroken)
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>
--
TWiki:Main.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
--
TWiki:Main.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.
--
TWiki:Main.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. Here's a patch for Render.pm
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
--
TWiki:Main.PeterNixon
- 06 Jul 2005
This patch passed necessary testing and has been applied to the DEVELOP branch.
--
TWiki:Main.PeterNixon
- 06 Jul 2005
Fix record
Discussion