1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

12851 replace bleach with nh3 (#14767)

* 12851 replace bleach with nh3

* Move tags & attributes lists to constants.py

---------

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
This commit is contained in:
Arthur Hanson
2024-01-11 06:31:32 -08:00
committed by GitHub
parent f8199339f5
commit 8254e707b6
4 changed files with 35 additions and 29 deletions

View File

@ -69,3 +69,27 @@ CSV_DELIMITERS = {
'semicolon': ';',
'tab': '\t',
}
#
# HTML allowed tags & attributes
#
HTML_ALLOWED_TAGS = {
"a", "b", "blockquote", "br", "code", "dd", "del", "div", "dl", "dt", "em", "h1", "h2", "h3", "h4", "h5", "h6",
"hr", "i", "img", "li", "ol", "p", "pre", "strong", "table", "tbody", "td", "th", "thead", "tr", "ul"
}
HTML_ALLOWED_ATTRIBUTES = {
"a": {"href", "title"},
"div": {"class"},
"h1": {"id"},
"h2": {"id"},
"h3": {"id"},
"h4": {"id"},
"h5": {"id"},
"h6": {"id"},
"img": {"alt", "src", "title"},
"td": {"align"},
"th": {"align"},
}