Commit 26a80f2d by Rocky Duan

fixed escape recovering bug

parent 0ae68e73
...@@ -213,12 +213,12 @@ wmdEditors = {} ...@@ -213,12 +213,12 @@ wmdEditors = {}
break break
text = processedText 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 /\\\\\\\\/g, ESCAPED_BACKSLASH
text = text.replace /\\begin\{([a-z]*\*?)\}([\s\S]*?)\\end\{\1\}/img, ($0, $1, $2) -> text = text.replace /\\begin\{([a-z]*\*?)\}([\s\S]*?)\\end\{\1\}/img, ($0, $1, $2) ->
processor("\\begin{#{$1}}" + $2 + "\\end{#{$1}}") processor("\\begin{#{$1}}" + $2 + "\\end{#{$1}}")
text = text.replace(new RegExp(ESCAPED_BACKSLASH), '\\\\\\\\') text = text.replace(new RegExp(ESCAPED_BACKSLASH, 'g'), '\\\\\\\\')
$div = $("<div>").html(text) $div = $("<div>").html(text)
cnt = 0 cnt = 0
...@@ -226,5 +226,6 @@ wmdEditors = {} ...@@ -226,5 +226,6 @@ wmdEditors = {}
$(code).html(processor(codeArchive[cnt], 'code')) $(code).html(processor(codeArchive[cnt], 'code'))
cnt += 1 cnt += 1
$div.html() text = $div.html()
text
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