").html(text)
-
- $div.find("code").each (index, code) ->
- codeArchive.push $(code).html()
- $(code).html(codeArchive.length - 1)
-
- text = $div.html()
- text = text.replace /\\\$/g, ESCAPED_DOLLAR
-
- while true
- if RE_INLINEMATH.test(text)
- text = text.replace RE_INLINEMATH, ($0, $1, $2, $3) ->
- processedText += $1 + processor("$" + $2 + "$", 'inline')
- $3
- else if RE_DISPLAYMATH.test(text)
- text = text.replace RE_DISPLAYMATH, ($0, $1, $2, $3) ->
- processedText += $1 + processor("$$" + $2 + "$$", 'display')
- $3
- else
- processedText += text
- break
-
- text = processedText
- text = text.replace(new RegExp(ESCAPED_DOLLAR, 'g'), '\\$')
-
- text = text.replace /\\\\\\\\/g, ESCAPED_BACKSLASH
- text = text.replace /\\begin\{([a-z]*\*?)\}([\s\S]*?)\\end\{\1\}/img, ($0, $1, $2) ->
- processor("\\begin{#{$1}}" + $2 + "\\end{#{$1}}")
- text = text.replace(new RegExp(ESCAPED_BACKSLASH, 'g'), '\\\\\\\\')
-
- $div = $("
").html(text)
- cnt = 0
- $div.find("code").each (index, code) ->
- $(code).html(processor(codeArchive[cnt], 'code'))
- cnt += 1
-
- text = $div.html()
-
- text
diff --git a/lms/templates/discussion/index.html b/lms/templates/discussion/index.html
index b0ca1a2ffa..d8a2607944 100644
--- a/lms/templates/discussion/index.html
+++ b/lms/templates/discussion/index.html
@@ -10,6 +10,7 @@
<%block name="js_extra">
<%include file="_js_body_dependencies.html" />
+<%static:js group='discussion'/>
%block>
<%include file="../courseware/course_navigation.html" args="active_page='discussion'" />