Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修复一个Bug. 保留模板中的换行符。 #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

修复一个Bug. 保留模板中的换行符。 #3

wants to merge 1 commit into from

Conversation

colin-han
Copy link

你好,我在使用中出现错误。这里的实现没有看懂。但是,按照我的方式修改后,一切正常了。 :)

我是一个js新手,修改不当的地方,欢迎指正。

@wsds
Copy link

wsds commented Mar 15, 2012

这个问题我也遇到过,这段代码有点玄幻。求解释。
addText: function(buf, text, encode_newline) {
if (! text) return;
var s = text.replace(/[']/g, '$&').replace(/\n/g, '\n').replace(/\r/g, '\r');
buf.push("_buf+='", s, "'");
},
这里为什么要将换行符替换一下?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants