[FIX] summernote lib: When we edit a text in a existing link (with the modal) a link is created into the previous link
This commit is contained in:
@@ -334,10 +334,13 @@ define([
|
||||
}
|
||||
|
||||
rng = rng.deleteContents();
|
||||
var anchor = dom.ancestor(rng.sc, dom.isAnchor);
|
||||
|
||||
// Create a new link when there is no anchor on range.
|
||||
var anchor = rng.insertNode($('<A>' + linkText + '</A>')[0], true);
|
||||
$(anchor).attr({
|
||||
if (!anchor) {
|
||||
anchor = rng.insertNode($('<A>' + linkText + '</A>')[0], true);
|
||||
}
|
||||
$(anchor).html(linkText).attr({
|
||||
'href': linkUrl,
|
||||
'target': isNewWindow ? '_blank' : null,
|
||||
'class': className
|
||||
|
||||
Reference in New Issue
Block a user