symposion_app/vendor/symposion/text_parser.py
Joel Addison 447ed3eaf7 Reinstate Markdown support for symposion
Allow Markdown within the speaker bio and proposal abstract,
with a restricted set of tags for safety.
Render direct to markdown instead of storing plain and HTML
in the database.
Fix issue in timetable when a day had no slots created.
2025-01-03 12:00:06 +00:00

8 lines
161 B
Python

import bleach
tags = bleach.sanitizer.ALLOWED_TAGS | {'p', 'pre'}
def parse(text):
scrubbed_text = bleach.clean(text, tags=tags)
return scrubbed_text