summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2017-02-01 18:16:15 +0100
committerChristophe Simonis <chs@odoo.com>2017-02-01 18:16:15 +0100
commit71773e1f1cbc619da78c16ced4acd880dc685e3c (patch)
treec21c1ebfc70e2df3e4c63e57641ce57b4be82ccf /addons/web_editor/static/src
parent365d6a888dbb0b6b7829f6ea1f7dc70adf724ecf (diff)
parenta53063606a5aff62963f0cc4a149539ec35623b1 (diff)
[MERGE] forward port branch 9.0 up to a53063606a5
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 ead8ea8271c..318fc0c08fa 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]+/, ' '));
},