diff --git a/addons/web_editor/static/src/js/editor/odoo-editor/src/OdooEditor.js b/addons/web_editor/static/src/js/editor/odoo-editor/src/OdooEditor.js index 59a812fd8d7..3012f2cd79b 100644 --- a/addons/web_editor/static/src/js/editor/odoo-editor/src/OdooEditor.js +++ b/addons/web_editor/static/src/js/editor/odoo-editor/src/OdooEditor.js @@ -1803,7 +1803,7 @@ export class OdooEditor extends EventTarget { // If the end container was fully selected, extractContents may have // emptied it without removing it. Ensure it's gone. const isRemovableInvisible = (node, noBlocks = true) => - !isVisible(node, noBlocks) && !isUnremovable(node) && node.nodeName !== 'A'; + !isVisible(node, noBlocks) && !isUnremovable(node); const endIsStart = end === start; while (end && isRemovableInvisible(end, false) && !end.contains(range.endContainer)) { const parent = end.parentNode; diff --git a/addons/web_editor/static/src/js/editor/odoo-editor/test/spec/copyPaste.test.js b/addons/web_editor/static/src/js/editor/odoo-editor/test/spec/copyPaste.test.js index d00c4d0f2da..569e4ac4512 100644 --- a/addons/web_editor/static/src/js/editor/odoo-editor/test/spec/copyPaste.test.js +++ b/addons/web_editor/static/src/js/editor/odoo-editor/test/spec/copyPaste.test.js @@ -1285,6 +1285,15 @@ describe('Copy and paste', () => { contentAfter: '
', }); }); + it('should paste and transform URL over the existing url', async () => { + await testEditor(BasicEditor, { + contentBefore: 'ab[http://www.xyz.com]cd
', + stepFunction: async editor => { + await pasteText(editor, 'https://www.xyz.xdc '); + }, + contentAfter: 'abhttps://www.xyz.xdc []cd
', + }); + }); }); describe('range not collapsed', async () => { it('should paste and transform an URL in a p', async () => {