Ticket #220 (closed Bug: fixed)

Opened 7 years ago

Last modified 7 years ago

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) (diff)

Original html:

<p>This is some <strong>sample text</strong>. You are using <a href="http://www.fckeditor.net/">FCKeditor</a>.</p>
<p>Testing</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

comment:1 Changed 7 years ago by fredck

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

Confirmed with IE6 and FF2.

comment:2 Changed 7 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 7 years ago by fredck

  • Milestone set to FCKeditor 2.4.3

comment:4 Changed 7 years ago by alfonsoml

https://sourceforge.net/tracker/index.php?func=detail&aid=1506097&group_id=75348&atid=543653 has been marked as dup.

Other examples:

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

source result:

<ul>
<li><a href="http://www.url.com">a</a></li>
<li><a
href="javascript:void(0);/*1150296505859*/">b</a></li>
</ul>

think the correct is:

<ul>
<li><a href="http://www.url.com">a</a></li>
<li><a href="http://www.url.com">b</a></li>
</ul>

comment:5 Changed 7 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 7 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 7 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 7 years ago by fredck

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

Fixed with [341].

Click here for more info about our SVN system.

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