fixed escape recovering bug

This commit is contained in:
Rocky Duan
2012-08-06 23:00:38 -04:00
parent 0ae68e7324
commit 26a80f2d9b

View File

@@ -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 = $("<div>").html(text)
cnt = 0
@@ -226,5 +226,6 @@ wmdEditors = {}
$(code).html(processor(codeArchive[cnt], 'code'))
cnt += 1
$div.html()
text = $div.html()
text