From 8d68324b7b76235ae66850d900843112fd40baac Mon Sep 17 00:00:00 2001 From: Agrendalath Date: Tue, 27 Jun 2023 16:31:54 +0200 Subject: [PATCH] feat: allow more attributes in `a` tag --- html_xblock/__init__.py | 2 +- html_xblock/bleaching.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/html_xblock/__init__.py b/html_xblock/__init__.py index 14b8f6b..055396e 100644 --- a/html_xblock/__init__.py +++ b/html_xblock/__init__.py @@ -1,4 +1,4 @@ """HTML XBlock module.""" from .html import ExcludedHTML5XBlock, HTML5XBlock -__version__ = "1.3.4" +__version__ = "1.3.5" diff --git a/html_xblock/bleaching.py b/html_xblock/bleaching.py index 9cf3a54..801c9ce 100644 --- a/html_xblock/bleaching.py +++ b/html_xblock/bleaching.py @@ -95,7 +95,7 @@ def _get_allowed_attributes(self): """ attributes = { '*': ['class', 'style', 'id'], - 'a': ['href', 'title', 'target', 'rel'], + 'a': ['href', 'title', 'target', 'rel', 'data-toggle', 'role', 'aria-expanded', 'aria-controls'], 'abbr': ['title'], 'acronym': ['title'], 'audio': ['controls', 'autobuffer', 'autoplay', 'src'], @@ -162,8 +162,11 @@ def _get_allowed_styles(self): "width", 'border', 'border-style', + 'margin', 'margin-left', 'margin-right', + 'margin-top', + 'margin-bottom', 'padding-left', 'padding-right', ]