Tags:
archive_me1Add my vote for this tag create new tag
, view all tags

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

TWiki version: TWikiRelease02Sep2004
TWiki plugins: DefaultPlugin, CommentPlugin
Server OS:  
Web server:  
Perl version:  
Client OS:  
Web Browser:  

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

Edit | Attach | Watch | Print version | History: r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r2 - 2005-02-25 - CrawfordCurrie
 
  • 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.