From d347492cb168cdec834e3eb42ef0d746f4319887 Mon Sep 17 00:00:00 2001 From: Brian Jacobel Date: Wed, 10 Aug 2016 15:19:53 -0400 Subject: [PATCH] Fix discussion markdown previews TNL-5198 --- common/static/common/js/discussion/utils.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common/static/common/js/discussion/utils.js b/common/static/common/js/discussion/utils.js index 4e96363cc8..18ed34e5c9 100644 --- a/common/static/common/js/discussion/utils.js +++ b/common/static/common/js/discussion/utils.js @@ -321,7 +321,8 @@ imageUploadUrl = this.urlFor('upload'); _processor = function(self) { return function(text) { - return self.postMathJaxProcessor(text); + // HTML returned by Markdown is assumed to be safe to render + return self.postMathJaxProcessor(edx.HtmlUtils.HTML(text)).toString(); }; }; editor = Markdown.makeWmdEditor(elem, appended_id, imageUploadUrl, _processor(this));