Skip to content

Commit 72d8179

Browse files
committed
update
1 parent ad3f78f commit 72d8179

File tree

1 file changed

+21
-19
lines changed

1 file changed

+21
-19
lines changed

src/guestbook/utils.py

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -25,25 +25,27 @@ def allow_src(_, name, value):
2525

2626

2727
ALLOWED_ATTRS = {"a": ["href"], "img": allow_src, "code": ["class"]}
28-
ALLOWED_TAGS = [
29-
"p",
30-
"br",
31-
"strong",
32-
"em",
33-
"hr",
34-
"code",
35-
"pre",
36-
"ul",
37-
"ol",
38-
"li",
39-
"h1",
40-
"h2",
41-
"h3",
42-
"h4",
43-
"h5",
44-
"h6",
45-
"img",
46-
]
28+
ALLOWED_TAGS = frozenset(
29+
{
30+
"p",
31+
"br",
32+
"strong",
33+
"em",
34+
"hr",
35+
"code",
36+
"pre",
37+
"ul",
38+
"ol",
39+
"li",
40+
"h1",
41+
"h2",
42+
"h3",
43+
"h4",
44+
"h5",
45+
"h6",
46+
"img",
47+
}
48+
)
4749

4850

4951
def optimize_img_tag(img: Tag):

0 commit comments

Comments
 (0)