Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#220 closed Bug (fixed)

Link/Anchor multiple paragraphs create buggy links

Reported by: anonymous Owned by: fredck
Priority: Normal Milestone: FCKeditor 2.4.3
Component: General Version: FCKeditor 2.4
Keywords: Confirmed Cc:

Description (last modified by fredck)

Original html:

<p>This is some <strong>sample text</strong>. You are using <a href="">FCKeditor</a>.</p>
<p>One Two Three</p>

Select all content and add an anchor or link, then the html is changed to:

<p><a name="anchor1">This is some <strong>sample text</strong>. You are using FCKeditor.</a></p>
<p><a href="javascript:void(0);/*1173334815335*/">Testing</a></p>
<p><a href="javascript:void(0);/*1173334815335*/">One Two Three</a></p>

Change History (8)

comment:1 Changed 10 years ago by fredck

  • Description modified (diff)
  • Keywords Confirmed added
  • Summary changed from Anchor content to Link/Anchor multiple paragraphs create buggy links

Confirmed with IE6 and FF2.

comment:2 Changed 10 years ago by lizl

I am seeing this on images as well. If you add an image and then select it and add a link, I sometimes (not always - and its unclear why this happens) get an IE error "Object doesnt support this property" and the link ends up being "javascript:void(0);/*1172707931797*" instead of the URL I entered.

This often happens after a few images have been added to the page.

The workaround is to allow the bad link to be added then edit the link - on edit putting in the correct link works fine, unlike the add.

comment:3 Changed 10 years ago by fredck

  • Milestone set to FCKeditor 2.4.3

comment:4 Changed 10 years ago by alfonsoml has been marked as dup.

Other examples:

  • create a unordered list;
  • select two or more list items;
  • insert hiperlink;

source result:

<li><a href="">a</a></li>

think the correct is:

<li><a href="">a</a></li>
<li><a href="">b</a></li>

comment:5 Changed 10 years ago by alfonsoml

paste in FCK HTML source edition mode:

<strong>blah A blah </strong>blah B blah

Back to WYSIWYG, If I select text from A to B and create a link, the following code is generated:

<strong>blah <a href="http://link">A blah </a></strong><a
href="javascript:void(0);/*1166175937000*/">blah B </a>blah

Moved from SF

comment:6 Changed 10 years ago by alfonsoml

What should we do about this one?

I thought about it some time ago, the problem is quite clear: in the FCK.CreateLink function the call to FCK.ExecuteNamedCommand( 'CreateLink', sTempUrl ) ; does creates several links to generate valid code, but then the function just search for one link and that's what it does return and is properly adjusted later in the caller.

We could get all those links and just let the url set to the desired one, but if the user wants to set other properties of the link they will be placed only on the first one. To avoid it we could change the function to return a collection of all the generated links and the caller should iterate over them.

Or we could work with the first link and if there is any other link that has been generated remove them.

Anyway, it seems that the first step would be to get all the generated links and then remove the extra ones or set them all to the desired url.

I think that we should do the later: make all the urls of the links the desired one and only return the first one in the function to avoid changing now too many places.

comment:7 Changed 10 years ago by fredck

  • Owner set to fredck
  • Status changed from new to assigned

The only real solution is making FCK.CreateLink() to return an array. Other solutions would not reflect the user intensions, so those would just be dirty fixes.

I'll work on it right now.

comment:8 Changed 10 years ago by fredck

  • Resolution set to fixed
  • Status changed from assigned to closed

Fixed with [341].

Click here for more info about our SVN system.

Note: See TracTickets for help on using tickets.
© 2003 – 2017 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy