Add highlighting back in
This commit is contained in:
@@ -429,13 +429,13 @@ if Backbone?
|
||||
|
||||
display_body: ->
|
||||
if @has("highlighted_body")
|
||||
@get("highlighted_body")
|
||||
String(@get("highlighted_body")).replace(/<highlight>/g, '<mark>').replace(/<\/highlight>/g, '</mark>')
|
||||
else
|
||||
@get("body")
|
||||
|
||||
display_title: ->
|
||||
if @has("highlighted_title")
|
||||
@get("highlighted_title")
|
||||
String(@get("highlighted_title")).replace(/<highlight>/g, '<mark>').replace(/<\/highlight>/g, '</mark>')
|
||||
else
|
||||
@get("title")
|
||||
|
||||
|
||||
@@ -64,9 +64,7 @@ class @DiscussionThreadListView extends Backbone.View
|
||||
url: url
|
||||
type: "GET"
|
||||
success: (response, textStatus) =>
|
||||
console.log textStatus
|
||||
if textStatus == 'success'
|
||||
@collection.reset(response.discussion_data)
|
||||
console.log(@collection)
|
||||
|
||||
@delay(callback, 300)
|
||||
|
||||
@@ -6,6 +6,7 @@ class @DiscussionThreadView extends Backbone.View
|
||||
template: _.template($("#thread-template").html())
|
||||
|
||||
render: ->
|
||||
console.log(@model)
|
||||
@$el.html(@template(@model.toJSON()))
|
||||
@model.bind "change", @updateModelDetails
|
||||
if window.user.following(@model)
|
||||
@@ -24,7 +25,7 @@ class @DiscussionThreadView extends Backbone.View
|
||||
|
||||
convertMath: ->
|
||||
element = @$(".post-body")
|
||||
element.html DiscussionUtil.postMathJaxProcessor DiscussionUtil.markdownWithHighlight element.html()
|
||||
element.html DiscussionUtil.postMathJaxProcessor(element.html())
|
||||
MathJax.Hub.Queue ["Typeset", MathJax.Hub, element.attr("id")]
|
||||
|
||||
renderResponses: ->
|
||||
|
||||
Reference in New Issue
Block a user