symposion_app/vendor/symposion/symposion/text_parser.py
Ben Sturmfels 34509d23eb
Make vendored symposion into an installable Python package
This allows us to install with `pip install "-e vendor/symposion"` similar to
the other vendored packages. There's no good reason for this to be different to
the others and depend on PYTHONPATH hacking.

Re-add
2023-04-24 16:38:25 +10:00

9 lines
175 B
Python

import bleach
tags = bleach.sanitizer.ALLOWED_TAGS[:]
tags.extend(['p', 'pre'])
def parse(text):
scrubbed_text = bleach.clean(text, tags=tags)
return scrubbed_text