Commit 0868aefe by Ibrahim Awwal Committed by Matthew Mongeau

Fix markdown in thread bodies and comments.

parent f796c030
......@@ -54,7 +54,7 @@ class @DiscussionThreadInlineView extends DiscussionContentView
convertMath: ->
element = @$(".post-body")
element.html DiscussionUtil.postMathJaxProcessor(element.html())
element.html DiscussionUtil.postMathJaxProcessor DiscussionUtil.markdownWithHighlight element.html()
MathJax.Hub.Queue ["Typeset", MathJax.Hub, element[0]]
renderResponses: ->
......
......@@ -43,7 +43,7 @@ class @DiscussionThreadView extends DiscussionContentView
convertMath: ->
element = @$(".post-body")
element.html DiscussionUtil.postMathJaxProcessor(element.html())
element.html DiscussionUtil.postMathJaxProcessor DiscussionUtil.markdownWithHighlight element.html()
MathJax.Hub.Queue ["Typeset", MathJax.Hub, element[0]]
renderResponses: ->
......
......@@ -2,6 +2,7 @@ class @ResponseCommentView extends DiscussionContentView
tagName: "li"
template: _.template($("#response-comment-template").html())
initLocal: ->
# TODO .response-local is the parent of the comments so @$local is null, not sure what was intended here...
@$local = @$el.find(".response-local")
@$delegateElement = @$local
......@@ -14,8 +15,9 @@ class @ResponseCommentView extends DiscussionContentView
@convertMath()
@
convertMath: ->
body = @$(".response-body")
body = @$el.find(".response-body")
body.html DiscussionUtil.postMathJaxProcessor DiscussionUtil.markdownWithHighlight body.html()
# This removes paragraphs so that comments are more compact
body.children("p").each (index, elem) ->
$(elem).replaceWith($(elem).html())
MathJax.Hub.Queue ["Typeset", MathJax.Hub, body[0]]
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment