Index: _whatsnew.html
===================================================================
--- _whatsnew.html (revision 1981)
+++ _whatsnew.html (working copy)
@@ -81,6 +81,8 @@
correctly restored when undoing changes made by the Replace dialog.
[#2160] "Match whole word" in the
Find and Replace dialog will now find words next to punctuation marks as well.
+ [#1691] Creation of links in Safari
+ failed if there was no selection.
Version 2.6
Index: editor/_source/internals/fck_gecko.js
===================================================================
--- editor/_source/internals/fck_gecko.js (revision 1981)
+++ editor/_source/internals/fck_gecko.js (working copy)
@@ -415,6 +415,12 @@
// Creates the array that will be returned. It contains one or more created links (see #220).
var aCreatedLinks = new Array() ;
+ // Only for Safari, a collapsed selection may create a link. All other
+ // browser will have no links creates. So, we check it here and return
+ // immediatelly, having the same cross browser behavior.
+ if ( FCKSelection.GetSelection().isCollapsed )
+ return aCreatedLinks ;
+
FCK.ExecuteNamedCommand( 'Unlink', null, false, !!noUndo ) ;
if ( url.length > 0 )
@@ -434,12 +440,6 @@
var oLink = oLinksInteractor.snapshotItem( i ) ;
oLink.href = url ;
- // It may happen that the browser (aka Safari) decides to use the
- // URL as the link content to not leave it empty. In this case,
- // let's reset it.
- if ( sTempUrl == oLink.innerHTML )
- oLink.innerHTML = '' ;
-
aCreatedLinks.push( oLink ) ;
}
}