Index: /CKEditor/trunk/CHANGES.html
===================================================================
--- /CKEditor/trunk/CHANGES.html (revision 5661)
+++ /CKEditor/trunk/CHANGES.html (revision 5662)
@@ -53,4 +53,5 @@
#5860 : [IE] > in attribute values are incorrectly escaped.
#5905 : SCAYT is not any more enabled by default.
+ #5736 : Improved the text generated for mailto: links if no text was selected.
Index: /CKEditor/trunk/_source/plugins/link/dialogs/link.js
===================================================================
--- /CKEditor/trunk/_source/plugins/link/dialogs/link.js (revision 5661)
+++ /CKEditor/trunk/_source/plugins/link/dialogs/link.js (revision 5662)
@@ -1298,5 +1298,7 @@
if ( ranges.length == 1 && ranges[0].collapsed )
{
- var text = new CKEDITOR.dom.text( attributes._cke_saved_href, editor.document );
+ // Short mailto link text view (#5736).
+ var text = new CKEDITOR.dom.text( data.type == 'email' ?
+ data.email.address : attributes._cke_saved_href, editor.document );
ranges[0].insertNode( text );
ranges[0].selectNodeContents( text );
@@ -1349,7 +1351,11 @@
element.setAttributes( attributes );
element.removeAttributes( removeAttributes );
- // Update text view when user changes protocol #4612.
- if (href == textView)
- element.setHtml( attributes._cke_saved_href );
+ // Update text view when user changes protocol (#4612).
+ if ( href == textView || data.type == 'email' && textView.indexOf( '@' ) != -1 )
+ {
+ // Short mailto link text view (#5736).
+ element.setHtml( data.type == 'email' ?
+ data.email.address : attributes._cke_saved_href );
+ }
// Make the element display as an anchor if a name has been set.
if ( element.getAttribute( 'name' ) )