diff options
| author | Christophe Simonis <chs@odoo.com> | 2018-06-14 18:03:26 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2018-06-14 18:03:26 +0200 |
| commit | 804d68efe540c5ad121e811258a7fe11a29bdf56 (patch) | |
| tree | cb9a0ad936c8fd0bca77b7a79bf50288f970475e /addons/web_editor/static/src | |
| parent | ed47e3a5462d6a35dd5affa3beea7deff408fced (diff) | |
| parent | 23a1bce2a9c3a7a9cbfbb4c554ebacb337d9470e (diff) | |
[MERGE] forward port branch 10.0 up to 23a1bce2a9c
Diffstat (limited to 'addons/web_editor/static/src')
| -rw-r--r-- | addons/web_editor/static/src/js/rte.summernote.js | 2 | ||||
| -rw-r--r-- | addons/web_editor/static/src/js/widgets.js | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/addons/web_editor/static/src/js/rte.summernote.js b/addons/web_editor/static/src/js/rte.summernote.js index 6ba5ac6eeaa..f6435d0e6fe 100644 --- a/addons/web_editor/static/src/js/rte.summernote.js +++ b/addons/web_editor/static/src/js/rte.summernote.js @@ -476,7 +476,7 @@ function prettify_html(html) { while (i--) space += ' '; return space; }, - reg = /^<\/?(a|span|font|strong|u|i|strong|b)(\s|>)/i, + reg = /^<\/?(a|span|font|u|em|i|strong|b)(\s|>)/i, inline_level = Infinity, tokens = _.compact(_.flatten(_.map(html.split(/</), function (value) { value = value.replace(/\s+/g, ' ').split(/>/); diff --git a/addons/web_editor/static/src/js/widgets.js b/addons/web_editor/static/src/js/widgets.js index 005d085fec8..dc347c61690 100644 --- a/addons/web_editor/static/src/js/widgets.js +++ b/addons/web_editor/static/src/js/widgets.js @@ -320,8 +320,7 @@ var ImageDialog = Widget.extend({ var img = this.images[0]; if (!img) { - var id = this.$(".existing-attachments [data-src]:first").data('id'); - img = _.find(this.images, function (img) { return img.id === id;}); + return this.media; } var media; @@ -1023,6 +1022,8 @@ var LinkDialog = Dialog.extend({ if (dom.ancestor(nodes[i], dom.isImg)) { this.data.images.push(dom.ancestor(nodes[i], dom.isImg)); text += '[IMG]'; + } else if (!is_link && nodes[i].nodeType === 1) { + // just use text nodes from listBetween } else if (!is_link && i===0) { text += nodes[i].textContent.slice(so, Infinity); } else if (!is_link && i===nodes.length-1) { |
