summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2017-02-10 18:41:06 +0100
committerChristophe Simonis <chs@odoo.com>2017-02-10 18:41:06 +0100
commita282d4ae7f27869a0b828e8562f8efd901e02799 (patch)
tree1fa369ee7526a0a7ccee075f0d8232d2f4fac870 /addons/web_editor/static/src
parentb229e9cb8c1fdc83a1aa5abd51141e32aea59bcd (diff)
parentbe9dfb331f90bd0352728c78e115bc3647f472e9 (diff)
[MERGE] forward port branch saas-14 up to be9dfb331f9
Diffstat (limited to 'addons/web_editor/static/src')
-rw-r--r--addons/web_editor/static/src/js/translator.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/addons/web_editor/static/src/js/translator.js b/addons/web_editor/static/src/js/translator.js
index 4fd9825567f..bc431f3ba55 100644
--- a/addons/web_editor/static/src/js/translator.js
+++ b/addons/web_editor/static/src/js/translator.js
@@ -177,6 +177,10 @@ var Translate = Widget.extend({
},
rte_changed: function (node) {
var $node = $(node);
+ $node.find("p").each(function () { // remove <p/> element which might have been inserted because of copy-paste
+ var $p = $(this);
+ $p.after($p.html()).remove();
+ });
var trans = this.getTranlationObject($node[0]);
$node.toggleClass('o_dirty', trans.value !== $node.html().replace(/[ \t\n\r]+/, ' '));
},