summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/lib
diff options
context:
space:
mode:
Diffstat (limited to 'addons/web_editor/static/lib')
-rw-r--r--addons/web_editor/static/lib/summernote/src/js/module/Editor.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/addons/web_editor/static/lib/summernote/src/js/module/Editor.js b/addons/web_editor/static/lib/summernote/src/js/module/Editor.js
index 732072b5d24..a30ee9c18c8 100644
--- a/addons/web_editor/static/lib/summernote/src/js/module/Editor.js
+++ b/addons/web_editor/static/lib/summernote/src/js/module/Editor.js
@@ -629,7 +629,11 @@ define([
}
var anchors = [];
- if (isTextChanged) {
+ // ODOO: adding this branch to modify existing anchor
+ var ancestor_anchor = dom.ancestor(rng.sc, dom.isAnchor);
+ if(ancestor_anchor) {
+ anchors.push($(ancestor_anchor).html(linkText).get(0));
+ } else if (isTextChanged) {
// Create a new link when text changed.
var anchor = rng.insertNode($('<A>' + linkText + '</A>')[0]);
anchors.push(anchor);