Bug: Comment plugin won't work on anchors
When using the comment plugin with a target defined as an anchor, it works the first time, but will break the anchor afterwards (Initially reported in
CommentPluginDev by
LyallPearce).
Test case
See
http://twiki.org/cgi-bin/rdiff/Plugins/CommentPluginDev?rev1=1.265&rev2=1.264
Environment
--
OlivierBerger - 24 Feb 2005
Impact and Available Solutions
Follow up
Fix record
Apply this patch :
--- Comment.pm.orig 2005-02-24 18:27:40.000000000 +0100
+++ Comment.pm 2005-02-24 18:29:22.000000000 +0100
@@ -275,9 +275,9 @@
} elsif ( $anchor ) {
# position relative to anchor
if ( $position eq "BEFORE" ) {
- $text =~ s/^($anchor)/$output$1/m;
+ $text =~ s/^($anchor)/$output\n$1/m; # put newline after comment to keep anchor left justified
} else { # AFTER
- $text =~ s/^($anchor)/$1$output/m;
+ $text =~ s/^($anchor)/$1\n$output/m; # put newline before comments so don't merge with anchor
}
} else {
# Position relative to index'th comment
Discussion
Dunno if this bug should have been filed here... but as the
CommentPlugin seems to be shipped with the
CairoRelease, I assume this is OK.
--
OlivierBerger - 24 Feb 2005
Olivier, I haven't got time to do all the testing around this, but I will assume you are certain that this isn't a problem with the OUTPUT template. I have checked in your changes (and those of
JacobEisinger) and made a new release, so please makes sure it works. Thanks!
You should really report plugin bugs in the Support web, but in this instance you will get faster response by posting here.
--
CrawfordCurrie - 25 Feb 2005