diff --git a/course/page/code.py b/course/page/code.py index c7ed5a2109a9e3c2560e831a476a8dd63f36d284..76963871c77be41496ed52f3e66f63bb77a38652 100644 --- a/course/page/code.py +++ b/course/page/code.py @@ -906,6 +906,9 @@ class PythonCodeQuestion(PageBaseWithTitle, PageBaseWithValue): else: return False + if not isinstance(s, six.text_type): + return _("(Non-string in 'HTML' output filtered out)") + return bleach.clean(s, tags=bleach.ALLOWED_TAGS + ["audio", "video", "source"], attributes={