#220 closed Bug (fixed)
Link/Anchor multiple paragraphs create buggy links
Reported by: | anonymous | Owned by: | Frederico Caldeira Knabben |
---|---|---|---|
Priority: | Normal | Milestone: | FCKeditor 2.4.3 |
Component: | General | Version: | FCKeditor 2.4 |
Keywords: | Confirmed | Cc: |
Description (last modified by )
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 (8)
comment:1 Changed 18 years ago by
Description: | modified (diff) |
---|---|
Keywords: | Confirmed added |
Summary: | Anchor content → Link/Anchor multiple paragraphs create buggy links |
comment:2 Changed 18 years ago by
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 18 years ago by
Milestone: | → FCKeditor 2.4.3 |
---|
comment:4 Changed 18 years ago by
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 18 years ago by
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 18 years ago by
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 18 years ago by
Owner: | set to Frederico Caldeira Knabben |
---|---|
Status: | new → 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 18 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Fixed with [341].
Click here for more info about our SVN system.
Confirmed with IE6 and FF2.