if (value !== '') {
this.editor.focus();
host.setSelection(this._currentSelection);
+
+ // We add a prefix if it is not already prefixed.
+ value = value.trim();
+ var expr = new RegExp(/^[a-zA-Z]*\.*\/|^#|^[a-zA-Z]*:/);
+ if (!expr.test(value)) {
+ value = 'http://' + value;
+ }
+
document.execCommand('unlink', false, null);
document.execCommand('createLink', false, value);