From 26a80f2d9b60ca11c25507c59108891999dd6aa3 Mon Sep 17 00:00:00 2001 From: Rocky Duan Date: Mon, 6 Aug 2012 23:00:38 -0400 Subject: [PATCH] fixed escape recovering bug --- lms/static/coffee/src/discussion/utils.coffee | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lms/static/coffee/src/discussion/utils.coffee b/lms/static/coffee/src/discussion/utils.coffee index 657c7c12e5..e822c53a06 100644 --- a/lms/static/coffee/src/discussion/utils.coffee +++ b/lms/static/coffee/src/discussion/utils.coffee @@ -213,12 +213,12 @@ wmdEditors = {} break text = processedText - text = text.replace(new RegExp(ESCAPED_DOLLAR), '\\$') + 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), '\\\\\\\\') + text = text.replace(new RegExp(ESCAPED_BACKSLASH, 'g'), '\\\\\\\\') $div = $("
").html(text) cnt = 0 @@ -226,5 +226,6 @@ wmdEditors = {} $(code).html(processor(codeArchive[cnt], 'code')) cnt += 1 - $div.html() + text = $div.html() + text