Tags:
create new tag
, view all tags

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

TWiki version: TWikiAlphaRelease
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS: OS X 10.3
Web server: Apache 1.3.33
Perl version: 5.8.1-RC3
Client OS: OS X 10.3
Web Browser: Firefox 1.0.4

-- 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! smile )

-- 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

Topic attachments
I Attachment History Action Size Date Who Comment
Unknown file formatgz HeaderRenderingWithWikiWordsBroken.trunk.4553.patch.gz r1 manage 0.6 K 2005-07-09 - 12:56 PeterNixon Patch against trunk version 4553
Edit | Attach | Watch | Print version | History: r9 < r8 < r7 < r6 < r5 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r9 - 2005-07-09 - PeterNixon
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.