Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
e.preventDefault();
toolbar._class.remove('ed-link-input-active');
me.caret.restore();
var url = input.value;
var node = me.caret.parent();
if (url) {
if (!/https?:\/\//.test(url)) {
url = 'http://' + url;
}
if (node.tagName.toLowerCase() === 'a') {
node.href = url;
} else {
format.a(url);
}
} else {
format.unlink();
}
}
}
events.bind(input, 'blur', linky);