• Do not register here on develop.twiki.org, login with your twiki.org account.
• Use View topic Item7848 for generic doc work for TWiki-6.1.1. Use View topic Item7851 for doc work on extensions that are not part of a release. More... Close
• Anything you create or change in standard webs (Main, TWiki, Sandbox etc) will be automatically reverted on every SVN update.
Does this site look broken?. Use the LitterTray web for test cases.

Description of the problem

Take this example topic text:

%TOC%

---+ Headline
This is a (!Test).

If you preview this topic, the "Headline" item in the table of contents is garbled with parameters like

formtemplate=;templatetopic=;topicparent=;newtopic=;
and so on.

Diagnosis

Here is what I found out and what I think where the problem is located.

in TWiki.pm, subroutine _TOC

near the comment "create linked bullet item":
$target = ...
the (!Test) is not escaped.

in Render.pm, subroutine getRenderedVersion

now the (!Test) is changed into (<nop>Test)

in Preview.pm, subroutine preview

near the comment "Disable links and inputs in the text": The given regexp tries to find the <a ... > ... </a>, but after finding <a it stops at the first >, that's at the end of <nop> because there is the topic text inside the href of the a-tag.

-- TWiki:Main/ChristianLudwig - 13 Feb 2007

wow, thanks for the detailed analysis!

my my, this is caused by the following code in TWiki:_TOC

    # Find URL parameters
    my $query = $this->{cgiQuery};
    my @qparams = ();
    foreach my $name ( $query->param ) {
      next if ($name eq 'keywords');
      next if ($name eq 'topic');
      push @qparams, $name => $query->param($name);
    }
have added next if ($name eq 'text'); to fix it, but, I cannot understand why we are appending all random url parameters to the TOC - in preview, that includes: sig,action_preview,originalrev,skin,cover,redirectto,formtemplate,templatetopic,settingstopic,topicparent,newtopic,cmd

-- SvenDowideit - 14 Feb 2007

ItemTemplate
Summary Preview TOC entries are garbled if topic text contains (!AnyWord)
ReportedBy TWiki:Main.ChristianLudwig
Codebase 4.1.1, ~twiki4
SVN Range TWiki-4.1.1, Fri, 09 Feb 2007, build 12817
AppliesTo Engine
Component

Priority Normal
CurrentState Closed
WaitingFor

Checkins 12874 12875
TargetRelease patch
ReleasedIn 4.1.2
Edit | Attach | Watch | Print version | History: r5 < r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r5 - 2007-02-15 - SvenDowideit
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback