Source code for oioioi.quizzes.utils

import bleach
from django.utils.safestring import mark_safe

[docs]ALLOWED_TAGS = frozenset(list(bleach.ALLOWED_TAGS) + ['br', 'pre', 'tt', 'hr'])
[docs]ALLOWED_ATTRIBUTES = bleach.ALLOWED_ATTRIBUTES
[docs]def quizbleach(text): return mark_safe( bleach.clean(text, tags=ALLOWED_TAGS, attributes=ALLOWED_ATTRIBUTES) )