Skip to content

Commit 8bcef9f

Browse files
kweinmeistertelpirion
authored andcommitted
fix: migrate run markdown-preview sample to bleach 6 (#9057)
1 parent 7a1f4af commit 8bcef9f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

run/markdown-preview/renderer/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ def index():
2929
html = markdown.markdown(data)
3030

3131
# Keep the paragraph tags
32-
bleach.sanitizer.ALLOWED_TAGS.append('p')
32+
allowed_tags = list(bleach.sanitizer.ALLOWED_TAGS) + ['p']
3333
# Sanitize and return
34-
clean = bleach.clean(html, strip=True)
34+
clean = bleach.clean(html, strip=True, tags=allowed_tags)
3535
return clean
3636

3737

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
Flask==2.1.0
22
gunicorn==20.1.0
33
Markdown==3.4
4-
bleach==5.0.0
4+
bleach==6.0.0

0 commit comments

Comments
 (0)