From ef02b9c1ed3287334afd6bec01c09e36fe63e6ca Mon Sep 17 00:00:00 2001 From: colin-han Date: Mon, 26 Dec 2011 21:57:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=80=E4=B8=AABug.=20?= =?UTF-8?q?=E4=BF=9D=E7=95=99=E6=A8=A1=E6=9D=BF=E4=B8=AD=E7=9A=84=E6=8D=A2?= =?UTF-8?q?=E8=A1=8C=E7=AC=A6=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nTenjin.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nTenjin.js b/nTenjin.js index eb59d53..bb0f9d3 100644 --- a/nTenjin.js +++ b/nTenjin.js @@ -118,7 +118,7 @@ nTenjin.Template.prototype = { addText: function(buf, text, encode_newline) { if (! text) return; - var s = text.replace(/[\'\\]/g, '\\$&').replace(/\n/g, '\\n\\\n'); + var s = text.replace(/[\'\\]/g, '\\$&').replace(/\n/g, '\\n').replace(/\r/g, '\\r'); buf.push("_buf+='", s, "'"); },