[FIX] web_editor: prevent double insert link on paste

When pasting text containing url, the url was pasted twice.
One being simple text and the other one being a link.

Task ID: 2602785

closes odoo/odoo#73709

Signed-off-by: Antoine Guenet <Zinston@users.noreply.github.com>
This commit is contained in:
Nicolas Bayet
2021-07-19 07:38:07 +00:00
parent 6113a8c48c
commit d1fcb9ac74
@@ -2148,8 +2148,8 @@ export class OdooEditor extends EventTarget {
},
];
this.execCommand('insertText', splitAroundUrl[i]);
if (['jpg', 'jpeg', 'png', 'gif'].includes(urlFileExtention)) {
this.execCommand('insertText', splitAroundUrl[i]);
this.commandBar.open({
commands: [
{
@@ -2171,6 +2171,7 @@ export class OdooEditor extends EventTarget {
].concat(baseEmbedCommand),
});
} else if (youtubeUrl) {
this.execCommand('insertText', splitAroundUrl[i]);
this.commandBar.open({
commands: [
{