If you use the location to specify where to place the comment, it will only match if its above the comment tag. Otherwise, it seems to match itself, and the output is placed above the comment tag.
--
TWiki:Main/AndrewJones86
- 27 Feb 2007
Heh; nasty. I can imagine that might happen. Do you have a testcase, please? Use
LitterTray web.
CC
Have created a test case here:
Item3689Test
Cheers.
--
TWiki:Main.AndrewJones86
- 27 Feb 2007
Yep. That is confirmed.
--
KennethLavrsen - 27 Feb 2007
I have fixed this for my local install. Maybe you can patch the release. All I have done is modified the regex to skip lines starting with a
%
sign (i.e. %COMMENT..).
The code is below, starting at line 250 in lib/TWiki/Plugins/CommentPlugin/Comment.pm
if ( $position eq 'BEFORE' ) {
$text =~ s/^[^\%]($location)/$output$1/m;
} else { # AFTER
$text =~ s/^[^\%]($location)/$1$output/m;
}
Obviously, if people decide to use the start of line in location, then this will break it. But its a quick fix anyway.
--
TWiki:Main.AndrewJones86
- 01 Mar 2007
It would be an easy check to see if
location="
is not just before the match.
--
TWiki:Main.ArthurClemens
- 10 Apr 2007
Done.
--
TWiki:Main.ArthurClemens
- 10 Apr 2007
Also fixed a warning in locations, highlighted while unit testing.
CC