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

Item3649: Only one %REV{}% statement per line

Item Form Data

AppliesTo: Component: Priority: CurrentState: WaitingFor: TargetRelease ReleasedIn
Extension RevisionLinkPlugin Normal Closed TWiki:Main.KennethLavrsen n/a  

Edit Form Data

Summary:
Reported By:
Codebase:
Applies To:
Component:
Priority:
Current State:
Waiting For:
Target Release:
Released In:
 

Detail

Plugin version: 18 May 2006 (2.0 - SVN 10228)

It seems that you can have only one REV per line. I think this a bug.

For example, the following statement provides only one output:

Test1: %REV{"TestTopic1" rev="1"}% Test2: %REV{"TestTopic1" rev="2"}%

Output:
Test1: TestTopic1(1)

Expected output:
Test1: TestTopic1(1) Test2: TestTopic1(2)

This is quite annoying for example when you would like to use REV in tables.

-- TWiki:Main/SamiMertaranta - 16 Feb 2007

I know why.

The plugin has a strange syntax rule allowing brackets so the tag is not handled in a very optimal way. And there is a plain bug in the plugin.

You need the following to fix it: A '?' put the right place.

Find the line in RevisionLinkPlugin.pm that says

  $_[0] =~ s/%REV[{\[](.*)[}\]]%/&handleRevision($1, $_[1], $_[2])/geo;

and replace it with

  $_[0] =~ s/%REV[{\[](.*?)[}\]]%/&handleRevision($1, $_[1], $_[2])/geo;

The technical explanation is that the regex was greedy.

When you write

Test1: %REV{"TestTopic1" rev="1"}% Test2: %REV{"TestTopic1" rev="2"}%

Then the '.*' part of the regex matches as much as it can between %REV{ and }%

So it eats almost the entire line

"TestTopic1" rev="1"}% Test2: %REV{"TestTopic1" rev="2"

The little ?-mark makes the regex non-greedy matching only

"TestTopic1" rev="1"

and in the 2nd round

"TestTopic1" rev="2"

I will check in a fix later today when I am home at my SVN checkout and upload a new rev of the plugin.

-- TWiki:Main.KennethLavrsen - 16 Feb 2007

New version uploaded

-- TWiki:Main.KennethLavrsen - 16 Feb 2007

ItemTemplate
Summary Only one %REV{}% statement per line
ReportedBy TWiki:Main.SamiMertaranta
Codebase 4.0.0
SVN Range

AppliesTo Extension
Component RevisionLinkPlugin
Priority Normal
CurrentState Closed
WaitingFor TWiki:Main.KennethLavrsen
Checkins 12903 12904
TargetRelease n/a
ReleasedIn

Edit | Attach | Watch | Print version | History: r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r4 - 2007-02-16 - KennethLavrsen
 
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