Item8269: CommentPlugin: broken anchor target

pencil
Priority: Urgent
Current State: Closed
Released In: 1.0.7
Target Release: patch
Applies To: Extension
Component: CommentPlugin
Branches:
Reported By: Foswiki:Main.MichaelDaum
Waiting For:
Last Change By: KennethLavrsen
The check to find a given anchor in the target topic is boken. It does not match a single anchor on a line of its own like:

#InsertHere

Patch:
@@ -339,7 +339,7 @@
     {
         undef $location;
     }
-    if ( defined($anchor) and not( $text =~ /^($anchor\s)/ ) ) {
+    if ( defined($anchor) and $text !~ /$anchor/ ) {
         undef $anchor;
     }

-- MichaelDaum - 09 Sep 2009

The fix broke the unit tests.

Reopening.

Not sure if it is the fix or the unit test that is wrong.

-- KennethLavrsen - 11 Sep 2009

Checked the fix and it is partly OK.

Sven changed the behavior in Item727 so that missing anchor means same as no target.

Now this fails so the comment is appended to the bottom always.

So fix is flawed

-- KennethLavrsen - 11 Sep 2009

Yes. New code finds anchors that are not anchors.

Old code found anchors only on first line.

Need to identify anchors correctly in code

-- KennethLavrsen - 11 Sep 2009

Fixed so it finds anchors that are correctly placed at beginning of any line. And allowing white space after which people or Wysiwyg editor may add without knowing.

Unit tests pass and are fine

-- KennethLavrsen - 11 Sep 2009
 

ItemTemplate edit

Summary CommentPlugin: broken anchor target
ReportedBy Foswiki:Main.MichaelDaum
Codebase 1.0.6, trunk
SVN Range Foswiki-1.0.0, Thu, 08 Jan 2009, build 1878
AppliesTo Extension
Component CommentPlugin
Priority Urgent
CurrentState Closed
WaitingFor
Checkins distro:8c49e3e1ef6f distro:645f5df884c7 distro:3213da8c0e17 distro:7718fd60c612
TargetRelease patch
ReleasedIn 1.0.7
Topic revision: r12 - 20 Sep 2009, KennethLavrsen
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy