摘要: handlebars.js 用 替换掉 内容的换行符JS:Handlebars.registerHelper('breaklines', function(text) { text = Handlebars.Utils.escapeExpression(text); text = text.toString(); text = text.replace(/(\r\n|\n|\r)/gm, ''); return new Handlebars.SafeString(text);}); HTML template: {{breaklines description} 阅读全文
posted @ 2013-09-10 17:10 曾祥展 阅读(1633) 评论(0) 推荐(0) 编辑