From b100626de024a2e93cbdc09f8a3cfd4636181832 Mon Sep 17 00:00:00 2001 From: Stanislas Gueniffey Date: Mon, 20 Feb 2023 09:16:15 +0000 Subject: [PATCH] [FIX] web_editor: allow copy-pasting link target The `target` attribute for a link specifies where that link should open (for example, in a new tab). Previously, copy-pasting links in the website editor (within text blocks for example) would remove the `target` attribute. This implied loss of functionality. This commit whitelists the `target` attribute to fix that behavior. task-3184150 closes odoo/odoo#113908 X-original-commit: 1464752aca36198e5fed5dc8f5b5041244e6e4a9 Signed-off-by: David Monjoie (dmo) --- .../static/src/js/editor/odoo-editor/src/OdooEditor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 8395c492fba..5149097a760 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 @@ -166,7 +166,7 @@ export const CLIPBOARD_WHITELISTS = { /^btn/, /^fa/, ], - attributes: ['class', 'href', 'src'], + attributes: ['class', 'href', 'src', 'target'], styledTags: ['SPAN', 'B', 'STRONG', 'I', 'S', 'U', 'FONT'], styles: { 'text-decoration': { defaultValues: ['', 'none'] },