From 1f6005070f8daa060c4dfae8a2fc2d84e60ab7ed Mon Sep 17 00:00:00 2001 From: Damien Abeloos Date: Thu, 29 Sep 2022 10:27:29 +0000 Subject: [PATCH] [IMP] tools: keep additional data when sanitizing Purpose is to allow to have ``data-behavior-props`` and ``data-prop-name`` on HTML nodes and keep it even when HTML content is sanitized. Those attributes will be used notably in Knowledge application to store some structured content e.g. used to populate props. Prepares Task-2796156 Prepares odoo/enterprise#29423 X-original-commit: 7ddb4685567c115ca4e14fa7e5f845b0cb33fd7c Part-of: odoo/odoo#101694 --- odoo/tools/mail.py | 1 + 1 file changed, 1 insertion(+) diff --git a/odoo/tools/mail.py b/odoo/tools/mail.py index 2202b5ceea7..48b26a58a8e 100644 --- a/odoo/tools/mail.py +++ b/odoo/tools/mail.py @@ -35,6 +35,7 @@ safe_attrs = clean.defs.safe_attrs | frozenset( 'data-publish', 'data-id', 'data-res_id', 'data-interval', 'data-member_id', 'data-scroll-background-ratio', 'data-view-id', 'data-class', 'data-mimetype', 'data-original-src', 'data-original-id', 'data-gl-filter', 'data-quality', 'data-resize-width', 'data-shape', 'data-shape-colors', 'data-file-name', 'data-original-mimetype', + 'data-behavior-props', 'data-prop-name', # knowledge commands ]) SANITIZE_TAGS = { # allow new semantic HTML5 tags