[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:
@@ -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: [
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user