-
Notifications
You must be signed in to change notification settings - Fork 66
/
constants.py
100 lines (95 loc) · 1.4 KB
/
constants.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
DEFAULT_ALLOWED_TAGS = [
"p",
"div",
"span",
"h1",
"h2",
"h3",
"h4",
"h5",
"h6",
"tt",
"pre",
"em",
"strong",
"ul",
"sup",
"li",
"dl",
"dd",
"dt",
"code",
"img",
"a",
"table",
"tr",
"th",
"td",
"tbody",
"caption",
"colgroup",
"thead",
"tfoot",
"blockquote",
"ol",
"hr",
"br",
]
DEFAULT_ALLOWED_ATTRIBUTES = {
"*": [
"class",
"style",
"id",
],
"a": [
"href",
"target",
"rel",
"title",
],
"img": [
"src",
"alt",
"title",
],
"tr": [
"rowspan",
"colspan",
],
"td": [
"rowspan",
"colspan",
"align",
],
}
DEFAULT_ALLOWED_STYLES = [
"color",
"background-color",
"font-family",
"font-weight",
"font-size",
"width",
"height",
"text-align",
"border",
"border-top",
"border-bottom",
"border-left",
"border-right",
"padding",
"padding-top",
"padding-bottom",
"padding-left",
"padding-right",
"margin",
"margin-top",
"margin-bottom",
"margin-left",
"margin-right",
]
DEFAULT_BLEACH_KWARGS = {
"tags": DEFAULT_ALLOWED_TAGS,
"attributes": DEFAULT_ALLOWED_ATTRIBUTES,
"styles": DEFAULT_ALLOWED_STYLES,
}
SETTINGS_MODE_OVERRIDE = "override"