symposion_app/vendor/symposion/text_parser.py

9 lines
161 B
Python
Raw Normal View History

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